On In this fifth exercise, you'll learn how to populate set functions while iterating issue attachments.
The function Set allows the creation of new variables that will be treated as fields (mappings) and change the values of those variable valuesvariables.
The notation to define a set function is:
...
Info |
---|
You can check more details here. |
First, you have to create a set function count and in this case, you are going to initialize the value as to zero.
Code Block |
---|
${set(count,0)} |
As you know, if If you want to display your Attachments Iterations as a Table with a Header, you must first create the Header using a table with 3 columns and 1 row:
Name | Size | Time |
---|
And below you Below, put the #{for attachments} or #{for <VariableName>=AttachmentsCount} statement, so the Header is printed only one timeonce.
Then, you'll redefine the variable count to increment it by one. To do this, you'll use the set function again, but using the previous count value with javascriptJavaScript.
Code Block |
---|
${set(count,%{${count} + 1})} |
With that done, you create another table where the Issue attachments will be populated:
...
To display the current iteration index, we are going to print the redefined variable using ${count}.
...
Info |
---|
You can do this on other types of Iterations. You can check the iterations here. |
Below there is a sample of how the mappings will be displayed in a Word template:
...
- A header with an image
- Headings
- Text styling
- Table
Below there Below is a sample of how the generated file will be populated:
...
Info |
---|
If you like this exercise, please share your opinion on the page by just leaving leave a comment or a . Your opinion feedback is very important to us. Thank you in advance. Enjoy our product. |
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
Here 's the Exercise 5 related filesare the files related to this Exercise:
|