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

  1. Navigate to the App Launcher by selecting the app launcher in the upper left corner, select Nintex DocGen.
  2. Select the DocGen Packages tab.
  1. Click New.

  2. Type in the DocGen Package details and select your Starting Object.
  3. Click Save.
  4. 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.

  1. From the Relationships section, click the drop-down arrow , and click Add Child +.
  2. The New Child Relationship appears. For our example, please select the following options:

  1. In the Object drop-down, select Opportunity Product.
    • Opportunity Product is the Object selected because we want to group by product line items.
  2. 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.
  1. 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.
  2. In the Repeat By drop-down, select Group.
  3. In the Field drop-down, select Sales Price.
  4. In the Sort By drop-down, select Value Ascending.
  5. 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.
  6. If you want to filter the relationship, see how in Relationships.
  7. In the Order By field, select a Field and Sort option. This field is optional.
  8. Click Save.

Add grouping to an existing DocGen Package

  1. Navigate to the App Launcher by selecting the app launcher in the upper left corner, select Nintex DocGen.
  2. Select the DocGen Packages tab.
  1. Open the DocGen Package you want to add or edit a child relationship to.
  2. 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:

  1. In the Object drop-down, select Opportunity Product.
    • Opportunity Product is the Object selected because we want to group by product line items.
  2. 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.
  1. 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.
  2. In the Repeat By drop-down, select Group.
  3. In the Field drop-down, select Sales Price.
  4. In the Sort By drop-down, select Value Ascending.
  5. 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.
  6. If you want to filter the relationship, see how in Relationships.
  7. In the Order By field, select a Field and Sort option. This field is optional.
  8. 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:

  1. Navigate to the App Launcher by selecting the app launcher in the upper left corner, select Nintex DocGen.
  2. Select the DocGen Packages tab.
  1. Open the DocGen Package which you created the grouping relationship for.
  2. Open the Field Tagger in the top right corner.
  3. In Main Object, select the same object you used for the child relationship above.

    For our example, it would be Opportunity Product.

  4. 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.

  5. In the template, add the grouping start tag in the header row of your table.

    For our example, it would be: <<Grouping_Table_Start>>

  6. 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>>.

  7. Upload the template to your DocGen Package.

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.

  1. Navigate to the App Launcher by selecting the app launcher in the upper left corner, select Nintex DocGen.
  2. Select the DocGen Packages tab.
  1. Open the DocGen Package you added the grouping relationship and template.
  2. From the DocGen Package Tester, select the record associated with the DocGen Package.

    For our example, you would select Plastic Straws Co.

  3. Select a Contact.
  4. Select Download.
  5. 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.