How can I create an Apsona report, set up a document merge action, and add a Salesforce button to trigger the merge?

1) Create a Single-Step Report in Apsona
Document - Click here
Video - Click here

This report serves as the data source for your document merge and is essential for ensuring that you pull exactly the right information needed for your final documents. For example, you might use it to generate a PDF proposal exclusively for active opportunities exceeding $10K, which makes the data precise and relevant to the business process.
Navigate to the appropriate object tab in Apsona.
Go to the Report list, click New, and name your report.
Add the fields needed for your document template.
Use the filter section to limit results (e.g., filter by related object values).
Run the report to preview your data.

2A) Prepare Your Document Template
Document - Click here
Video - Click Here
If/Else Condition - Click Here

The document template defines the structure and appearance of your final output, allowing dynamic content to populate designated placeholders. This is vital for automating the generation of documents such as contracts, invoices, or onboarding documents, ensuring consistency and saving manual entry time.
Create your merge template using Word (.docx), Google Docs, or LibreOffice.mail
Add your text, images, and merge fields (e.g., {{Account_Name}}).
In Word: Insert merge fields using Quick Parts > Field > Mail Merge > MergeField.
Avoid spaces or special characters in field names (use underscores).
For sublists, include table start: and table end: tags within table rows.
Save the template and upload it to the Apsona Documents tab or link a Google Doc.

2B) Create the Merge Action (PDF Output)
Document - Click Here
Mapping Document - Click Here

The merge action automates the process of converting your report's data into a polished document based on your template, enabling you to instantly generate customer agreements or shipping forms without manual intervention. This integration streamlines operations and minimizes errors by linking Salesforce data directly to your document output.
From your report results page, click Merge/Mail and choose "Create new merge action".
Select your template source, pick your document template, and choose PDF output (select separate files if you plan to attach them to individual records).
Map fields between the report and the template. For sublists, link the additional reports using a common ID.
Set up logging options (e.g., attaching the generated PDFs to their corresponding records and creating Tasks). Use the "Test only" option for previewing.
Provide a name for your new merge action and save it.

3) Add a Merge Button in Salesforce (Lightning)
Document - Click Here
Video - Click Here

By adding a custom button on the Salesforce record page, users can trigger the merge action with just one click, eliminating the need to manually run reports. This convenience is especially beneficial for actions like "Generate Quote," where a sales rep can instantly create a document from within an Opportunity record.
Enable My Domain in Salesforce and ensure the Apsona Doc Gen Button V2 component is installed.
Go to Apsona Settings > Merge Actions, select your action, and click "Make button".
Choose the "Detail page for [Object]" option, then Generate and copy the code.
To add the button to the Lightning Page:
Navigate to a record detail page, click the gear icon, and select "Edit Page".
Drag the Apsona Doc Gen Button V2 component from the Lightning Components panel into your desired location.
Paste the code into the component’s Action Code field and configure the Button Text and Prompt Text.
Click Save to finalize your changes.