Dynamically display multiple output text nodes

You could do this all in html using the template
a simple example

[{"id":"9c0950b1.c61b1","type":"inject","z":"4484ee28.caa3c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"chart1","payload":"[\"text1\",\"text2\"]","payloadType":"json","x":140,"y":320,"wires":[["4bc18ffc.98da38"]]},{"id":"de1cd353.5326c","type":"inject","z":"4484ee28.caa3c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"chart1","payload":"[\"text1\",\"text2\",\"text3\"]","payloadType":"json","x":153.3333282470703,"y":385.3333435058594,"wires":[["4bc18ffc.98da38"]]},{"id":"4bc18ffc.98da38","type":"function","z":"4484ee28.caa3c","name":"","func":"var html = \"\";\nfor (var i in msg.payload){\n    html = html + '<label for=\"w' + i + '\">A title ' + i + '</label><textarea id=\"w' + i + '\" name=\"w' + i + '\" rows=\"4\" cols=\"50\">' + msg.payload[i] + '</textarea>';\n}\nmsg.template = html;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":390,"y":340,"wires":[["2b69d2df.753636"]]},{"id":"2b69d2df.753636","type":"ui_template","z":"4484ee28.caa3c","group":"165e1e1a.e752fa","name":"","order":2,"width":0,"height":0,"format":"","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":570,"y":340,"wires":[[]]},{"id":"165e1e1a.e752fa","type":"ui_group","z":"","name":"Default","tab":"f9b58883.fa613","order":1,"disp":true,"width":"12","collapse":false},{"id":"f9b58883.fa613","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

i have just done text areas but you could add text input form. There is an example in the info help text that show how to send a message.

1 Like