Template - Actions
In the Actions section, you can perform various operations to customize your document templates according to your requirements. These actions allow you to insert fields, pictures, tables, apply conditions, and set document titles.
After setting up your resources, you can use various actions to build your template. These actions include -
- Insert Field - This action enables you to insert any field, both standard and custom, retrieved from the Master Object. You can also create resources and insert them as needed.
- Insert Picture - With this action, you can insert pictures from URL fields into your document template.
- Insert Table - This action allows you to insert tables based on records from Salesforce. You can customize the table's structure and content as required.
- Insert Loop - This action allows you to repeat a section with fields inserted from an Object's record, over a set of records or Record Collection in a loop.
- Insert Condition - Insert conditions allow you to make conditional insertions of content, such as text, tables, or pictures, into your template. You can set up rules based on field values and apply logical operators to determine when the content is inserted.
- Insert Loop - This actionallows you to repeat a specific section of a template with fields dynamically populated from object records.
- Document Title - This action enables you to assign a title to the generated documents from your template. You can select a field to serve as the document title, providing clarity and organization to your document generation process.
These steps and actions will help you build a comprehensive and dynamic template tailored to your specific needs.
This action allows you to insert any field (standard or custom) retrieved from the Master Object. If you want to insert data from other objects, you can create resources and insert them as well. Follow the steps below to insert a field -
- Select Insert Field in the Select Action drop-down menu.
- Choose the Field using drop down menu. The Field drop-down lists the fields you can use to create merge fields in your Word template, which will populate with corresponding data from Salesforce. The drop-down lists the Master Object's fields under the "Global Variable" section as "Record" variable, the created variable resources under the "Variable" section and the standard constants under the "Global Constants" section.
- Once you select the field, click "Insert" to place the field on the work area at the cursor's location. You can also copy and paste inserted fields within the work area.
This action enables you to insert a picture from a URL field. Follow the steps below to insert a Picture -
- Select Insert Picture in the Select Action drop-down menu.
- Choose the URL Field using drop-down menu. The "URL" drop-down lists fields you can use to retrieve a public URL and insert the corresponding image.
- Once you select the field, click "Insert" to place the picture on the work area at the cursor's location. Adjust the placeholder of the inserted picture as needed.
This action enables you to insert Table based on Records from Salesforce. The Tables data can be based or retrieved from any Record Collection Variable Resource. As any Data Table, you can Name a Column in the 'Column Header' and the Data under a Column Header is displayed based on data from records in collection as row in the 'Column Data'.
To Insert a Table, follow the steps below -
- Select "Insert Table" in the "Select Action" action drop-down.
- Select any Record Collection Variable Resource in the 'Resource Type'. This shall be the collection variable on which the table is based.
- Give a Name to the Column in the 'Column Header'. You can type the Column Header or Select field or Resource.
- For 'Column Data', select any of the collection Variable record Object's field.
- In the similar manner, you can add as many columns as you want.
- Once finalised, click insert to insert the Table onto the template canvas.
This action allows you to conditionally insert any content (text, table, picture) into the template. Follow the steps below to insert a condition -
- Select "Insert Condition" in the "Select Action" drop-down menu.
- Select the content to be inserted based on the condition.
- Set Up the Rules:
- Add multiple rules using "+ Add condition".
- Rule Parameters:
- Field: Choose the field or variable whose value you want to evaluate.
- Operator: Select an operator based on the data type of the resource.
- Value:
- Select an existing variable, constant, or field.
- Manually enter a literal value or merge field.
- Logic Between Rules:
- AND:All rules must be met.
- OR:Any rule must be met.
- Custom: Custom rule logic. Provide the rule logic by entering characters:
- Use numbers to refer to each rule.
- Use AND, OR, or NOT to identify which combination of rules must be true.
- Use parentheses to group parts of the string together.
- Example: For
- Insert the Condition:
- Once the condition is set up, click "Insert" to apply the condition to the selected content.
- If the condition evaluates to true, the content is inserted in the generated document; otherwise, it will not be inserted.
The Insert Loop action allows you to repeat a specific section of a template with fields dynamically populated from object records. This repeated section is added consecutively in the template, with each iteration using field values from the next record in a collection. The records used for the loop can be retrieved from any Record Collection in Salesforce.
To insert a loop, first create a Record Collection Resource that defines the collection of records over which the loop will be performed. Example: If your base object is Account and you want to loop through related Opportunities , create a Record Collection Resource that retrieves all Opportunities where:
- Account Id = Record.Id (i.e., the current Account record's Id).
- Use the Select Action dropdown and choose Insert Loop .
- In the Resource Type dropdown, select the Record Collection Resource you just created.
The inserted loop will appear in the template with a placeholder section labeled "Click or tap here to enter text.”
- Click the placeholder to select it, erase the placeholder text, and begin creating the content for the loop using fields from the selected Record Collection. Use the Insert Field action to add fields dynamically within the loop.
In the image below, the loop iterates over related Opportunities. Inside the loop, two fields — Name and Opportunity Id — have been inserted as dynamic text.
When the document is generated, the loop content will repeat for each record in the collection. Each iteration will populate the fields with data from a single record in the collection. Example Output: For an Account with two related Opportunities, the content inside the loop will repeat twice, once for each Opportunity. Generated Document Sample:
This action allows you to assign a title to the documents generated from a given template. Follow the steps below to set a Document Title -
- Select "Document Title" in the "Select Action" drop-down menu.
- Choose a field to be set as the Document Title.
- Click "Save" to set the selected field as the Document Title. The generated document will have this name.