Grouped Replication
Use Grouped Replication to group similar types of data together in tables in your output documents.
For example, say you want to group product line items on the Opportunity object by sales price. In the image below, you will see a custom product line for Plastic Straws Co. In your output document, each product with the same sales price will appear in a table. If you have three sales prices, you will have three different tables.
Relationship types available with grouping
Grouping is only available for certain types of relationships Salesforce says, "A connection between two objects, used to create related lists in page layouts and detail levels in reports.".
Relationship | Description |
---|---|
Starting Object | Grouping is only available for parent relationships (related lists). |
Stand Alone Data | Select a Repeat By option of Group. |
Apex Data |
Select a Repeat By option of Group. |
For more information on Repeat By options, see Relationships
Template types you can use with grouping are:
- Microsoft Word
- Microsoft PowerPoint
Set up the grouping relationship
You'll need to set up your relationship for grouping using a new DocGen Package A customizable package that consists of your Salesforce data, documents, and delivery configurations for documents you want to generate. or edit a relationship from an existing DocGen Package.
Add a grouping relationship to a new DocGen Package
- Navigate to the App Launcher by selecting the in the upper left corner, select Nintex DocGen.
- Select the DocGen Packages tab.
-
Click New.
- Type in the DocGen Package details and select your Starting Object.
- Click Save.
Nintex DocGen will automatically add in the Starting Object and any child A relationship between two objects established by a lookup or a master-detail field. relationships it's associated with the object in the Relationships section. The starting object can't be edited unless a different object is selected.
- From the Relationships section, click the drop-down arrow , and click Add Child +.
The New Child Relationship appears. For our example, please select the following options:
- In the Object drop-down, select Opportunity Product.
- Opportunity Product is the Object selected because we want to group by product line items.
- In the Related By drop-down, select Opportunity ID.
- Opportunity ID is the only option because it describes the parent-child relationship between the Opportunity object and its products.
- In Alias, type Grouping for alias A name that can be given to a relationship tag (optional).. This field is optional, but we will use Grouping for our example.
- In the Repeat By drop-down, select Group.
- In the Field drop-down, select Sales Price.
- In the Sort By drop-down, select Value Ascending.
- For If No Records, select Delete Table if you want to remove tables with no records in the output. Select Keep Table if you want to keep empty tables in the output.
- If you want to filter the relationship, see how in Relationships.
- In the Order By field, select a Field and Sort option. This field is optional.
- Click Save.
Add grouping to an existing DocGen Package
- Navigate to the App Launcher by selecting the in the upper left corner, select Nintex DocGen.
- Select the DocGen Packages tab.
- Open the DocGen Package you want to add or edit a child relationship to.
- In the Relationships window, select the Opportunity object drop-down , then click Add Child +.
The New Child Relationship window will open. For our example, please select the following options:
- In the Object drop-down, select Opportunity Product.
- Opportunity Product is the Object selected because we want to group by product line items.
- In the Related By drop-down, select Opportunity ID.
- Opportunity ID is the only option because it describes the parent-child relationship between the Opportunity object and its products.
- In Alias, type Grouping for alias A name that can be given to a relationship tag (optional).. This field is optional, but we will use Grouping for our example.
- In the Repeat By drop-down, select Group.
- In the Field drop-down, select Sales Price.
- In the Sort By drop-down, select Value Ascending.
- For If No Records, select Delete Table if you want to remove tables with no records in the output. Select Keep Table if you want to keep empty tables in the output.
- If you want to filter the relationship, see how in Relationships.
- In the Order By field, select a Field and Sort option. This field is optional.
- Click Save.
If you want to edit an existing child relationship, see Relationships.
Prepare the grouping template with tags
Configure your template A document/file that can be added to a DocGen Package. Data can be filled into the document/file. to include tags A prefilled word block that DocGen selects for fields in your DocGen Package. The tag is a placeholder for the value being retrieved from Salesforce and it gets replaced with the relevant information when the document is generated. that include your alias A name that can be given to a relationship tag (optional). you created in the relationship, then upload the template to your DocGen Package and generate your output document. The tags will use table and row replication.
Below is a sample of what our grouping example would look like:
- Navigate to the App Launcher by selecting the in the upper left corner, select Nintex DocGen.
- Select the DocGen Packages tab.
- Open the DocGen Package which you created the grouping relationship for.
- Open the Field Tagger in the top right corner.
- In Main Object, select the same object you used for the child relationship above.
For our example, it would be Opportunity Product.
- In Alias, select the alias you typed in when you were creating the relationship.
For our example, it would be Grouping. You'll need the special tags that are created using the Alias.
- In the template, add the grouping start tag in the header row of your table.
For our example, it would be:
<<Grouping_Table_Start>>
- In the template, add the row start tag in the first non-header row in the table, followed by the data tags for each additional row. The row start tag would be the Replicate Row tag from the field tagger.
For our example, it would be:
<<Grouping_Start>>
, followed by the data tags for each additional row<<Grouping_Product2>>
and<<Grouping_UnitPrice>>
.- For more information on row and table replication, see Row Replication and Table and Slide Replication.
- Upload the template to your DocGen Package.
- For more information on, see Manage templates in DocGen Packages
Generate documents with grouped data into tables
After you have created the relationship and template, you're ready to generate your output document. For our example, you will output a document that shows product line items grouped by their sales price.
- Navigate to the App Launcher by selecting the in the upper left corner, select Nintex DocGen.
- Select the DocGen Packages tab.
- Open the DocGen Package you added the grouping relationship and template.
- From the DocGen Package Tester, select the record associated with the DocGen Package.
For our example, you would select Plastic Straws Co.
- Select a Contact.
- Select Download.
- Click Run DocGen Package.
Our output document below shows each product with the same sales price grouped into one table. Since we had three different sales prices, we have three different tables.