To add a PowerDoc Mail merge button on a view or form:

Go to make.powerapps.com
From the Apps secton, edit App
From entity in commandbar choose “Edit command bar”

Button on (sub)grid:

  • Choose “Main view” or “Sub view”
  • Add new button
  • as icon choose webresource “ctse_/mailmerge/mailmerge.svg”
  • as action choose “Javascript” and add webresource “ctse_/mailmerge/ribbon.js”
  • as function name type “Ctse.MailmergeRibbon.OpenDialog” and add parameter “SelectedControl”
  • as visibility choose conditional and use this formula: If(CountRows(Self.Selected.AllItems) > 0; true;false)
    Save and publish

Note: If using it on a “Sub view”, repeat above steps also choosing “Associated view”.

Button on form:

  • Choose “Main form”
  • Add new button
  • as icon choose webresource “ctse_/mailmerge/mailmerge.svg”
  • as action choose “Javascript” and add webresource “ctse_/mailmerge/ribbon.js”
  • as function name type “Ctse.MailmergeRibbon.OpenDialog” and add parameter “SelectedControl”
  • as visibility choose conditional and use this formula: If(IsBlank(Self.Selected.Item.{entity}); false; true)
    Save and publish

Note: when clicking the button, only templates of type Flow Mail merge from View/Form will be available.

Extra params in button command:

  • add string-parameter with value (NB: all keys and values are optional, use url-encoded values!), for example:
    dialogTitle=Mail%20Merge&hide=splitsize,createactivity,customtemplate,skipfirstlabels