I think you are close. Just that the text aggregator shouldn’t contain any brackets.
You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.
-
Copy the code below by clicking the copy button when you mouseover the top-right of the code block
-
Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV to paste in the canvas.
-
Click on each imported module and save it. You may need to remap some variables.
Modules JSON Export
{
"subflows": [
{
"flow": [
{
"id": 1,
"module": "builtin:BasicRepeater",
"version": 1,
"parameters": {},
"mapper": {
"start": "1",
"repeats": "10",
"step": "1"
},
"metadata": {
"designer": {
"x": 0,
"y": 0,
"name": "Build chapters"
},
"restore": {},
"expect": [
{
"name": "start",
"type": "number",
"label": "Initial value",
"required": true
},
{
"name": "repeats",
"type": "number",
"label": "Repeats",
"validate": {
"min": 0,
"max": 10000
},
"required": true
},
{
"name": "step",
"type": "number",
"label": "Step",
"required": true
}
]
}
},
{
"id": 2,
"module": "util:TextAggregator",
"version": 1,
"parameters": {
"rowSeparator": "other",
"otherRowSeparator": ", ",
"feeder": 1
},
"mapper": {
"value": "\"Chapter_{{1.i}}\": \"incomplete\""
},
"metadata": {
"designer": {
"x": 245,
"y": 0
},
"restore": {
"parameters": {
"rowSeparator": {
"label": "Other"
}
},
"extra": {
"feeder": {
"label": "Build chapters [1]"
}
},
"flags": {
"groupBy": {
"collapsed": true
},
"stopIfEmpty": {
"collapsed": true
}
}
},
"parameters": [
{
"name": "rowSeparator",
"type": "select",
"label": "Row separator",
"validate": {
"enum": [
"\n",
"\t",
"other"
]
}
},
{
"name": "otherRowSeparator",
"type": "text",
"label": "Separator"
}
],
"expect": [
{
"name": "value",
"type": "text",
"label": "Text"
}
],
"advanced": true
}
},
{
"id": 3,
"module": "util:ComposeTransformer",
"version": 1,
"parameters": {},
"mapper": {
"value": "{\n \"fields\": {\n \"ChaptersComplete\": {\n {{2.text}},\n \"introduction\": \"incomplete\",\n \"conclusion\": \"incomplete\",\n }\n }\n}"
},
"metadata": {
"designer": {
"x": 490,
"y": -5,
"name": "JSON",
"messages": [
{
"category": "last",
"severity": "warning",
"message": "A transformer should not be the last module in the route."
}
]
},
"restore": {},
"expect": [
{
"name": "value",
"type": "text",
"label": "Text"
}
]
}
}
]
}
],
"metadata": {
"version": 1
}
}