Using a SINGLE DataSource in PDF Butler #
A SINGLE DataSource retrieves information from a single Salesforce record and can also include fields from related objects. It is the most commonly used Data Source type and serves as the foundation for many PDF Butler document configurations.
For example, if your document is generated from an Opportunity, the Data Source can retrieve:
- Opportunity fields
- Related Account fields
- Owner information
- Primary Contact information
- Any other fields accessible through Salesforce relationships
Watch the video tutorial or review the related documentation to implement this feature.
Setting Up #
- Open PDF Butler and navigate to the Data Sources tab.
- Click New to create a new Data Source.
- Configure the Data Source with the following settings:
Type: Single Object
Object: Opportunity
A Single Object Data Source returns one Salesforce record. - After saving the Data Source, open the SOQL Builder.
The SOQL Builder allows you to create queries without manually writing SOQL. - Select the Opportunity fields required in your document. For example: Opportunity ID, Opportunity Name, Amount.
These fields become available as merge fields within the Doc Config. - Follow the Account relationship and select fields such as: Account Name, Account Description, Account ID.
- Add the following filter: OpportunityId = recordId
This ensures that the Data Source retrieves the Opportunity from which the document is being generated. - After selecting all required fields and filters, save the query.
- Open your Doc Config in PDF Butler.
- Load the newly created Data Source into the configuration.
- Create a Config Type for the merge field you want to populate.
- Assign the merge field that appears in your document.
- Save the Config Type and then save the Doc Config.
- Open an Opportunity record and generate the document using your configured Doc Config.