This article explains what adaptive sections are and how to create them based on the application and the type of connector used so they can populate the dynamic document.
Prerequisites
|
Important
|
What is an Adaptive section?
An Adaptive section, also called a repeating group, allows you to repeat a dynamic element (a table row or some text) based on variable data input. Adaptive sections rely on repeating group bindings and external/variable data so they can only be built when retrieving data originating from a Data Connector or an App Connector. Using repeating groups allow your templates to adapt to the variable data necessary.
For example:
The template should have a table that will adapt the number of rows depending on the number of products (description, quantity, and unit price) that are part of an opportunity. There are two opportunities, opportunity A contains 3 products, and opportunity B contains 4 products. Leveraging the repeating group binding will allow the table to adapt to the variable input and only display the correct amount of rows:
Important
|
When to use a repeating group?
The primary use cases for using a repeating group are:
- Repeating rows in tables (Word and PowerPoint).
- Repeating bullets in bulleted lists (Word).
- Repeating lines of text (Word).
How to set up a repeating group binding
Setting up a repeating group requires two main steps:
- Creating the main repeating group binding (Collection Expression) to create a link to the array of information required to be repeated.
- Creating the child bindings (CurrentItem) to the specific piece of information that should be repeated from the array (Collection Expression) .
Both steps are required to be performed for Word and PowerPoint, but will differ based on the origin of the variable data, Data Connector or App Connector, and based on the application used, Word or PowerPoint.
How to find suitable data for Collection Expression and Current Item
Finding suitable data for the collection expression and the current item is dependent on the external system being used.
- How to find the data available from the Salesforce App Connector?
- How to find the data available from the SharePoint App Connector?
Example with Salesforce: The array for the Collection Expression is highlighted in red, and the objects that can be used with CurrentItem are highlighted in green:
Finding suitable data for the collection expression and the current item will be possible from the Admin Center or directly within Template Designer.
The Collection Expression (highlighted in red) must be an array on the first level in the external data source, in the Admin Center, arrays will be represented with square brackets []
, in Template Designer, arrays will be represented with this icon when using a Data connector form response smart field. The Repeating Item must be part of the Collection Expression array and can be located either on the first level (highlighted in yellow) under the array or several levels deep inside the array (highlighted in green). In the Template Designer, the Repeating Item will only be visible once the repeating group has been created by drilling down the array originating from the Data connector form response smart field.
In the Admin Center: |
In Template Designer: |
How to create adaptive sections in a template
When building a smart template, it might be necessary to create a dynamic element that will create the correct amount of table rows, paragraphs, or bullet lists, based on variable input. Based on the origin of the variable data, Data Connector or App Connector, and based on the application used, Word or PowerPoint, the steps to create adaptive sections will differ.
NoteOnce the smart fields have been created, they can be edited, or deleted. |
Creating adaptive sections in Word using a Data Connector can be achieved following these steps:
- In Template Designer, navigate to the Template tab.
- Select the table row or line of text (with or without a bullet) that should contain the items that will be repeated.
- Click Add smart field.
This step doesn't apply if you are adding the very first smart field in the template. - Click on Form responses.
- Drill down the data connector question and click on the array represented with
.
- Optionally edit the Display Name.
The display name will be displayed in the Template tab once the smart field has been added. - Optionally, perform additional actions on the repeating group.
- Allow Insert And Delete Items will allow users to manually add a repeating row using the Repeating Section Content Control in Word once the template has been generated. By default, this option isn't checked.
- Edit binding: Allow editing of the binding syntax to tailor the smart field to specific needs by using functions, conditions, and operators to create more complex use cases. By default, the basic binding syntax will be used.
- Visibility: Edit the visibility of the smart field based on specific conditions.
- Click on Add to template. The repeating group has been successfully created and will be displayed in the Template tab. The actual items (CurrentItem) that should be repeated inside the document can now be created.
- Select the text inside the previously created repeating group that represents an item that should be repeated column from the data sources that should be used in the smart field.
- Click Add smart field.
- Click Repeating item.
The Repeating item smart field will only be displayed if the cursor is located inside the repeating group. - Select the desired data that should be repeated.
- Optionally, perform additional actions on the smart fields.
- Edit binding: Allow editing of the binding syntax to tailor the smart field to specific needs by using functions, conditions, and operators to create more complex use cases. By default, the basic binding syntax will be used.
- Visibility: Edit the visibility of the smart field based on specific conditions.
- Remove and keep content: this will remove the content control will be removed upon document generation and will effectively disable the document content updater on the smart field.
- Format (for dates only): Specify which date format should be used for this date in the template.
- Click on Add to template
The Repeating item will be injected into the template and will be displayed in the Template tab as part of the repeating group created in step 6. - Repeat steps 8 to 13 as many times as necessary to add all the relevant items that should be repeated.
Creating adaptive sections in Word using an App Connector can be achieved following these steps:
- In Template Designer, navigate to the Template tab.
- Select the table row or a line of text (with or without a bullet) that should contain the items that will be repeated.
- Click Add smart field.
This step doesn't apply if you are adding the very first smart field in the template.; - Click on Advanced.
- Click on Custom repeating group.
- Optionally edit the Display Name.
The display name will be displayed in the Template tab once the smart field has been added. - Manually type in the Collection expression for the array containing the items that should be repeated.
For a Collection expression originating from an App Connector, the expecting binding will be{{HostSystem.ArrayName}}
. - Optionally, perform additional actions on the repeating group
- Allow Insert And Delete Items: Will allow users to manually add a repeating row using the Repeating Section Content Control in Word once the template has been generated. By default, this option isn't checked.
- Edit binding: Allow editing of the binding syntax to tailor the smart field to specific needs by using functions, conditions, and operators to create more complex use cases. By default, the basic binding syntax will be used.
- Visibility: Edit the visibility of the smart field based on specific conditions.
- Click on Add to template.
The repeating group has been successfully created and will be displayed in the Template tab. The actual items (CurrentItem) that should be repeated inside the document can now be created. - Select the text inside the previously created repeating group that represents an item that should be repeated column from the data sources that should be used in the smart field.
- Click Add smart field.
- Click More.
- Click Custom text binding (or Custom image binding to insert an image).
- Optionally edit the Display Name.
The display name will be displayed in the Template tab once the smart field has been added. - Manually type in the Binding for the item that should be repeated.
For binding originating from an App Connector, the expecting binding will be{{CurrentItem.ItemName}}
for an item on the first level. If the item is located on a deeper level of the array, the level must be specified prior to the item that should be repeated, example of an item located on the second level{{CurrentItem.NameLevel1.LevelName2.ItemName}}
. - Optionally, perform additional actions on the smart fields.
- Visibility: Edit the visibility of the smart field based on specific conditions.
- Remove and keep content: This will remove the content control will be removed upon document generation and will effectively disable the document content updater on the smart field.
- Inherit Dimensions, Width, Height (for images only): Specify the dimensions of the image that will be inserted.
- Click on Add to template.
The Custom text binding for the CurrentItem will be inserted into the template and will be displayed in the Template tab as part of the repeating group created in step 9. - Repeat steps 11 to 17 as many times as necessary to add all the relevant items that should be repeated.
Data from Salesforce used from the above example, the array OpenActivities
is highlighted in red and the current items (ActivityDate
and Subject
) are highlighted in green:
Creating adaptive sections in PowerPoint using a Data Connector can be achieved following these steps:
- In the Template Designer, navigate to the Template.
- Select the table that should contain the items that will be repeated.
- Click Add smart field.
This step doesn't apply if you are adding the very first smart field in the template - Click on Form responses.
- Drill down the data connector question and click on the array represented with
.
- Enter the Display Name.
The display name will be displayed in the Template tab once the smart field has been added. - Optionally, perform additional actions on the repeating group:
- Allow Insert And Delete Items: Will allow users to manually add a repeating row using the Repeating Section Content Control in PowerPoint once the template has been generated. By default, this option isn't checked.
- Edit binding: Allow editing of the binding syntax to tailor the smart field to specific needs by using functions, conditions, and operators to create more complex use cases. By default, the basic binding syntax will be used.
- Visibility: Edit the visibility of the smart field.
- Click on Add to template.
The repeating group has been successfully created and will be displayed in the Template tab. The actual items (CurrentItem) that should be repeated inside the document can now be created. - Place your cursor inside a cell and manually type the desired binding.
The expecting binding will be{{CurrentItem.ItemName}}
for an item on the first level. If the item is located on a deeper level of the array, the level must be specified prior to the item that should be repeated, example of an item located on the second level{{CurrentItem.NameLevel1.LevelName2.ItemName}}
. - Repeat step 9 to populate the rest of the cells on the table row.
All CurrentItem elements created on the table must be located in the same table row.
Creating adaptive sections in PowerPonint using an App Connector can be achieved following these steps:
- In the Template Designer, navigate to the Template tab.
- Select the table that should contain the items that will be repeated.
- Click Add smart field.
This step doesn't apply if you are adding the very first smart field in the template. - Click on Advanced.
- Click on Custom repeating group.
- Optionally edit the Display Name.
The display name will be displayed in the Template tab once the smart field has been added. - Manually type in the Collection expression for the array containing the items that should be repeated.
For a Collection expression originating from an App Connector, the expecting binding will be{{HostSystem.ArrayName}}
- Optionally, perform additional actions on the repeating group:
- Allow Insert And Delete Items: Will allow users to manually add a repeating row using the Repeating Section Content Control in Word once the template has been generated. By default, this option isn't checked.
- Edit binding: Allow editing of the binding syntax to tailor the smart field to specific needs by using functions, conditions, and operators to create more complex use cases. By default, the basic binding syntax will be used.
- Visibility: Edit the visibility of the smart field based on specific conditions.
- Click on Add to template.
The repeating group has been successfully created and will be displayed in the Template tab. The actual items (CurrentItem) that should be repeated inside the document can now be created. - Place your cursor inside a cell and manually type the desired binding.
The expecting binding will be{{CurrentItem.ItemName}}
for an item on the first level. If the item is located on a deeper level of the array, the level must be specified prior to the item that should be repeated, example of an item located on the second level{{CurrentItem.NameLevel1.LevelName2.ItemName}}
. - Repeat step 10 to populate the rest of the cells on the table row.
All CurrentItem elements created on the table must be located in the same table row.
Data from Salesforce used from the above example, the array OpenActivities
is highlighted in red and the current items (ActivityDate
and Subject
) are highlighted in green:
Comments
Article is closed for comments.