1. What is the :concat() tag used for?
The :concat() tag allows you to combine the values of the same task completed across multiple occurrences, using a separator of your choice.
It can be used for tasks within:
- A repeatable section;
- An automatic selection;
- A manual selection;
- A creation.
This allows you to retrieve all values without specifying each index individually: [1], [2], [3], etc.
Syntax:
##TAG:concat(separator)##Replace TAG with your task’s tag and separator with the text you want to insert between values.
For example, to separate values with a comma followed by a space:
##TAG:concat(, )##2. How do you use the concat tag in practice?
Scenario: A technician carries out an inspection round of the pumps in a building. For each pump inspected, they complete a new occurrence of a repeatable section and enter the equipment name.
At the end of the round, you want to retrieve the list of inspected pumps.
Step 1: Configure the repeatable section
In your form, add a Repeatable section block named “Pump inspection”.
For this example, set a maximum of 5 occurrences.
Step 2: Add the task containing the pump name
Within this section, add a Text block named “Pump name”.
Copy its tag. For this example, we will use pump_name.
Step 3: Use the concat tag
To combine the names of the inspected pumps, use:
##pump_name:concat(, )##Step 4: Carry out the inspection round
The technician inspects 3 pumps and enters the following names across 3 occurrences:
Occurrence | Pump name |
1 | Lift pump PR-01 |
2 | Circulation pump PC-02 |
3 | Booster pump PS-03 |
The tag then returns:
Lift pump PR-01, Circulation pump PC-02, Booster pump PS-03The configuration adapts to the number of occurrences completed: you do not need to specify a tag for each of the 5 possible occurrences.
3. How do you customise the separator?
Everything inside the parentheses is used as the separator, including spaces.
Using the same pumps, here are a few examples:
Configuration | Result |
##pump_name:concat(, )## | Lift pump PR-01, Circulation pump PC-02, Booster pump PS-03 |
##pump_name:concat( ; )## | Lift pump PR-01 ; Circulation pump PC-02 ; Booster pump PS-03 |
##pump_name:concat( / )## | Lift pump PR-01 / Circulation pump PC-02 / Booster pump PS-03 |
Please note
The concat tag replaces the need to list occurrences manually
##pump_name[1]##, ##pump_name[2]##, ##pump_name[3]##, ##pump_name[4]##, ##pump_name[5]##You now only need a single tag:
##pump_name:concat(, )##