When generating a PowerPoint presentation in DocuMotor, the Repeating Slides function is often used. This creates a direct dependency between the number of slides in the presentation and the data, therefore, it is possible that the number of slides isn’t the same for each generated presentation. This makes it hard to use references (for example in agenda-type slides) that link to the particular sections of the presentation. In this tutorial, it will be explained how to overcome this problem by using reference bindings.
Desired Output
The desired output of this tutorial would be to be able to link to specific slides in the generated presentation without taking into account the number of slides in it.
Sample Data
The data that will be used in this tutorial can be found below. In this case, the data consists of two arrays of objects that will be used to generate repeating slides.
{
"London": [
{
"first_name": "Wileen",
"last_name": "Tasseler",
"phone": "3292447923",
"department": "Games",
"email": "wtasseler0@edublogs.org"
},
{
"first_name": "Barthel",
"last_name": "Derricoat",
"phone": "5344222175",
"department": "Games",
"email": "bderricoat1@fda.gov"
},
{
"first_name": "Meaghan",
"last_name": "Roswarn",
"phone": "7931068714",
"department": "Kids",
"email": "mroswarn2@rambler.ru"
}
],
"Tokyo": [
{
"first_name": "Liam",
"last_name": "Schlag",
"phone": "5442410621",
"department": "Toys",
"email": "lschlag0@xinhuanet.com"
},
{
"first_name": "Row",
"last_name": "Deas",
"phone": "9378867396",
"department": "Beauty",
"email": "rdeas1@blinklist.com"
},
{
"first_name": "Alexio",
"last_name": "Gorler",
"phone": "5886207858",
"department": "Kids",
"email": "agorler2@tumblr.com"
},
{
"first_name": "Caesar",
"last_name": "Belderson",
"phone": "6564499992",
"department": "Games",
"email": "cbelderson3@ihg.com"
},
{
"first_name": "Carly",
"last_name": "de Courcey",
"phone": "7486575863",
"department": "Sports",
"email": "cdecourcey4@europa.eu"
}
]
}
PowerPoint Template
The PowerPoint template used in this tutorial can be downloaded using the button below. The template already contains all the needed bindings.
Transformation
The transformation that is used in this tutorial is presented below. It is a simple transformation that consists of two arrays (LondonEmployees and TokyoEmployees) that will be used for the repeating slides, and three reference keys the use of which will be explained later. In this case, the values of the reference keys were hardcoded.
{
refLondon: 'London',
LondonEmployees: London,
refTokyo: 'Tokyo',
TokyoEmployees: Tokyo,
refInfo: 'Info'
}
Binding
In order to configure a reference in a presentation, two things need to be taken into consideration. The first part is the reference binding:
<<Reference:ReferencePath>Displayed_Text<>>
This binding is inserted into the slide where the link should be displayed. More specifically, ReferencePath needs to be replaced with a key (with a string value) from DocuMotor’s output data (in this case refLondon, refTokyo, and refInfo will be used, while Displayed_Text should be replaced with the text that will be displayed in the link. For example, in this case, the binding can look like this:
<<Reference:refLondon>London Employees<Reference>>
In order for the binding to work, the target slides need to be registered in order for them to be linked with the corresponding reference. This is done by adding the following to the notes section of the target slides:
#-- DocuMotor-References --#
NoteReferencePath1
NoteReferencePath2
NoteReferencePath3
#-- DocuMotor-References-End --#
In the code above, NoteReferencePath should be replaced with the same key that is used in the binding’s reference path. That way, the slide and the reference will be linked in the generated presentation. As it can be seen, multiple references can target the same slide by putting multiple NoteReferencePath values in its notes. Specifically for the binding that was presented in the example above, the following is inserted in the target slide’s notes:
#-- DocuMotor-References --#
refLondon
#-- DocuMotor-References-End --#
An overview of this example, and the general result of this function, is presented in the image below: