Within the Formstack Documents Managed Package (versions 1.238+), the built-in Visualforce page allows you to populate documents with data from Salesforce Reports.
To activate this page, create a new Tab:
- Under Setup > Tabs, create a New Visualforce Tab
- For the page, select WebMergeReport
- Enter a name for your Tab and save.
Once you have set up your Tab and activated it for your users, it will be available to merge. Simply click on the new tab, then you'll see a page like this where you need to pick the report and the document/data route you want to merge:
When the data is sent over to Formstack Documents, each row in the report will be sent over using "_rows" as the name of the merge field. You can then loop through the data in your document like you would a Child Relationship: /hc/articles/44592068522899
For example, to loop through all the data in your document, you can do something like this:
| Opportunity | Status | Amount |
| {tablerow from=$_rows item=_row}{$_row.NAME} | {$_row.STATUS} | {$_row.AMOUNT|number_format:2} |
Note: Formatting is case-sensitive when pulling ie: FIRST_NAME vs FirstName; these will need to be identical for running reports and deliveries.
We also suggest using Debug Mode to see the field names coming over from the report.
Create Individual Documents
If you would like to merge individual documents for each row in your report, there's an option under Additional Options. You can also check the box to combine all the documents into a single file and the file(s) will be delivered via the delivery option you have set up for that document.
In your template, you'll use your report columns as merge fields like {$NAME}, {$ADDRESS}, etc