About this article
In this article, we will explain what Adaptive sections are and how they are connected to Repeating Group bindings.
Sections in this article:
- What is an Adaptive section?
- When to use a repeating group?
- How to set up a repeating group binding?
- How to find suitable data for Collection Expression and Current Item?
- Repeating groups in Word
- Repeating groups in PowerPoint
Prerequisites
|
What is an Adaptive section?
An Adaptive section will allow 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. Using repeating groups will allow your templates to adapt to the variable data necessary.
For example:
I want to create a table that will adapt the number of rows depending on the number of products (name, quantity, and price) that is part of my opportunities. I have two opportunities, opportunity A contains 3 products, 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:
|
When to use a repeating group?
The primary use cases for using a repeating group is for:
- 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 these steps are required to be performed for Word or for PowerPoint but will be set up in different ways.
How to find suitable data for Collection Expression and Current Item?
The Collection Expression
must be an array on the first level in the external data source, in the Admin Center, arrays will be represented with square brackets []
(highlighted in red).
The CurrentItem
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).
Example with Data connector (external data source):
Repeating groups in Word
Creating the Collection Expression
- In Word, start by creating the element that should contain the items to be repeated in your document
(e.g., a table, a line of text with or without a bullet) - Open Templafy task pane in your Office application
- Go to the ellipsis menu in the task pane and click on
Dynamics Designer
- Go to the
Element
tab - Select the element that should be used to repeat data (created in step 1)
The full line of text, or the entire row of the table that should be repeated - Select
Repeating Group
in the dropdown - Add the
Collection Expression
{{Form.FormName.ArrayCollectionName}}
- the linked form field must be a data connector form field - or{{HostSystem.ArrayCollectionName}}
- Add your visibility binding
- Click
Create
Once the Collection Expression
has been created, the actual item (CurrentItem
) that should be repeated inside the document must be created.
Creating the CurrentItems
- Select a single part of the element you created your
Collection Expression
on
(e.g., some text inside the table row, or some text from the line of text) - In the
Element
tab, selectText
in the drop-down - Add the binding
{{CurrentItem.ItemName}}
- Click
Create
- Repeat the above steps for all required items to be repeated
Allow Insert And Delete Items
If Allow Insert And Delete Items
is checked the admin can un-lock the shortcut where end-users can manually add a repeating row using the Repeating Section Content Control in Word.
Repeating groups in PowerPoint
All the below steps must be performed in the Slide Master view.
Creating the Collection Expression
- In the Slide Master view, on a layout, create a table
- Open Templafy task pane in your Office application
- Go to the ellipsis menu in the task pane and click on
Dynamics Designer
- Go to the
Element
tab - Select the table (created in step 1)
- Select
Repeating Group
in the dropdown - Add the
Collection Expression
{{Form.FormName.ArrayCollectionName}}
- the linked form field must be a data connector form field - or{{HostSystem.ArrayCollectionName}}
- Add your visibility binding
- Click
Update
Once the Collection Expression
has been created, the actual item (CurrentItem
) that should be repeated inside the table must be created.
Creating the CurrentItems
- Inside a cell, write the desired binding
{{CurrentItem.ItemName}}
- Repeat the above steps for all required items to be repeated
|
Comments
0 comments
Article is closed for comments.