Document Generation
...
Template Creation
Template - Resources
Record Collection Variable
introduction a record collection variable is a collection of records creating a record collection variable involves selecting the object type and setting conditions on the record fields to create a record collection variable, follow the steps below click 'resources'; the resource manager opens up in the 'new resource' pane, select resource type from the drop down as 'record collection variable' enter a label , and the api name will automatically populate select the object you can limit the number of output records using the ' limit rows ' option filters to determine which records are retrieved in a record collection variable , you must define filter conditions these conditions help narrow down records from the selected object based on field values and matching criteria begin by selecting the main operator that controls how multiple conditions will be evaluated and all conditions must be true or at least one condition must be true custom allows for advanced expressions (e g , (1 and 2) or 3) once the main operator is set, define one or more filter conditions each condition includes a field from the selected object a comparison operator a value to compare against condition field the field dropdown allows you to select the specific object field that should be used to filter or identify a record based on matching criteria (e g , email , firstname, status, custom field c) operator choose a logical operator from the dropdown equals matches records with a field exactly equal to the specified value (e g , for string, picklist, number, boolean) not equals matches records where the field does not equal the given value (e g , for string, picklist, number, boolean) greater than matches records where the field value is numerically greater (e g , for integer, decimals, currency) greater than or equals matches records where the value is greater than or exactly equal (e g , for integer, decimals, currency) less than matches records with a value lower than the specified input (e g , for integer, decimals, currency) less than or equals matches records with a value that is less than or exactly equal (e g , for integer, decimals, currency) in matches records where the field value is one of multiple specified values (e g , for picklist, multi select picklist) not in excludes records that match any of the specified values (e g , for picklist, multi select picklist) like matches records based on partial text (e g , for text, email) value the value field is used to specify what the selected field should be compared against this can take multiple forms, depending on your use case global variables field value from the same object record ({!$record id}) record (single) variables field value from related records runtime variable dynamic runtime variable docid\ axlc5bzdbbimwpkbabj9 value passed into or generated within the flow that allows conditions to adapt based on the data being processed during execution global constants a direct input like the following {$globalconstant false} boolean false {$globalconstant true} boolean true {$globalconstant emptystring} represents a blank or empty value {$globalconstant currenttime} dynamically inserts the exact timestamp when the document is generated click + add condition to include additional filter rows the overall filter logic follows the main operator you selected (and/or/custom) order by (optional) you can optionally define the order in which matching records are sorted by selecting a field sorting can be done in ascending or descending order the sort order directly determines which records are fetched when a limit is applied for example, if a limit is set (e g , 10 records), the top records based on the specified order will be added to the collection variable group by (optional) grouping lets you summarize records by a selected field and return aggregated values—such as sum, average, maximum, minimum, and count—calculated from numeric fields within each group sum – total of all numeric values in the field across the collection average – mean of the field's values across the collection maximum / minimum – highest or lowest value of the field in the collection count – total number of records in the collection follow the steps below to group and summarize values select a group by field (e g , stage, status) define aggregations for grouped data field select a field to aggregate (e g , amount) function choose an aggregation method (e g , sum, avg, max, min, count) alias this will be automatically generated based on the selected field and function (e g , amount sum) click + add aggregation to define more important aggregation functions (e g , sum, avg, max, min, count) can only be applied to number type fields when grouping a record collection, results will only be returned if the selected aggregation fields are numeric non numeric fields (like text or dates) are not supported for these functions and will not produce valid aggregated results once records are grouped, only the group by field and the aggregated fields will be available for use in your template other fields from the original ungrouped records will not be accessible in the output to use the fields from the record collection variable, you will need to use the insert loop docid\ klnvhzwf08dvuzedw68tu or insert table docid\ alnjpvhrs9rc3rlfkqkny actions available in the template editor use case an account management team generates a monthly summary report for each customer using cloudfiles they want to include a breakdown of all related opportunities, grouped by stage, along with the total opportunity amount in each stage goal use a record collection variable to fetch all opportunities linked to the same account, group them by stage, and calculate the sum of opportunity amount for each stage this allows for dynamic summarization within the generated document below is the video demonstration of this use case \<video>