This is basic html template where is button. how to jump bottom array loop when it is clicked ? then show results back in html template ?. Does it require javascripting or is it possible to achieve with node ? So I want "A,B,C,D,E" to show up in the html template, where the button was clicked.
[
{
"id": "4eb8f9a24709610d",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "b6cca49dd65b0b9e",
"type": "array-loop",
"z": "4eb8f9a24709610d",
"name": "array-loop",
"key": "al1a60a19a718526",
"keyType": "msg",
"reset": false,
"resetValue": "value-null",
"array": "array",
"arrayType": "msg",
"x": 900,
"y": 420,
"wires": [
[],
[
"41364bb4b98299a5"
]
]
},
{
"id": "9ab995bc81dddbfb",
"type": "change",
"z": "4eb8f9a24709610d",
"name": "split msg.payload by \", \"",
"rules": [
{
"t": "set",
"p": "array",
"pt": "msg",
"to": "$split(msg.payload, ',')",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 690,
"y": 420,
"wires": [
[
"b6cca49dd65b0b9e"
]
]
},
{
"id": "c7b4176ef3628816",
"type": "function",
"z": "4eb8f9a24709610d",
"name": "return msg",
"func": "\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 990,
"y": 520,
"wires": [
[
"b6cca49dd65b0b9e"
]
]
},
{
"id": "41364bb4b98299a5",
"type": "delay",
"z": "4eb8f9a24709610d",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 820,
"y": 520,
"wires": [
[
"c7b4176ef3628816"
]
]
},
{
"id": "f3297970c165ee15",
"type": "template",
"z": "4eb8f9a24709610d",
"name": "html",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "<!DOCTYPE html>\n<html>\n <head>\n\n </head>\n <body>\n<button type=\"button\">Click -> show result of array loop</button>\n </body>\n</html>",
"output": "str",
"x": 810,
"y": 320,
"wires": [
[
"2dd9de48f82fce88"
]
]
},
{
"id": "2dd9de48f82fce88",
"type": "http response",
"z": "4eb8f9a24709610d",
"name": "",
"statusCode": "",
"headers": {},
"x": 970,
"y": 320,
"wires": []
},
{
"id": "b7aa11277bcd6495",
"type": "http in",
"z": "4eb8f9a24709610d",
"name": "",
"url": "/loop",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 320,
"y": 320,
"wires": [
[
"18ad284113c62d63"
]
]
},
{
"id": "18ad284113c62d63",
"type": "template",
"z": "4eb8f9a24709610d",
"name": "",
"field": "template.body",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "<div class=\"container\">\n <h1>Testi</h1>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"loop\">\n <button onclick=\"myFunction()\" type=\"button\" class=\"btn btn-primary btn-lg\">Paina</button>\n </div>\n </div>\n </div>\n</div>\n\n<script>\n myFunction(){\n console.log('hello');\n };\n\n \n</script>",
"output": "str",
"x": 560,
"y": 320,
"wires": [
[
"f3297970c165ee15"
]
]
},
{
"id": "c95559580864ce39",
"type": "inject",
"z": "4eb8f9a24709610d",
"name": "msg.payload = \"A, B, C, D, E\"",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "A,B,C,D,E",
"payloadType": "str",
"x": 420,
"y": 420,
"wires": [
[
"9ab995bc81dddbfb"
]
]
}
]