Hi, i am stuck at one point and unable to get to solution. I am almost there (or am I?).
i have an array output coming from mysql query, which i need to convert to a string with a semicolon between each string. I can do this manually by using template node with mustache format, but the output from mysql query is dynamic and number of records keep varying based on query condition, so I end up with either less number of mustache template or will get series of extra semicolons. (this is working by the way, since extra semicolons are ignored).
Is there an elegant way to do this ? have given sample input and expected output in inject nodes.
[{"id":"b38fb534d33b53f6","type":"inject","z":"804978a6e5408fa5","name":"Input from MySQL Query","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[[{\"email\":\"someone1@somewhere.com\"},{\"email\":\"someone2@somewhere.com\"},{\"email\":\"someone3@somewhere.com\"},{\"email\":\"someone4@somewhere.com\"},{\"email\":\"someone5@somewhere.com\"},{\"email\":\"someone6@somewhere.com\"},{\"email\":\"someone7@somewhere.com\"}]]","payloadType":"json","x":210,"y":1080,"wires":[["858e43b95512654b"]]},{"id":"d5916c48b28f8265","type":"inject","z":"804978a6e5408fa5","name":"Expected Output","props":[{"p":"to","v":"someone1@somewhere.com;someone2@somewhere.com;someone3@somewhere.com;someone4@somewhere.com;someone5@somewhere.com;someone6@somewhere.com;someone7@somewhere.com","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":300,"y":1160,"wires":[["7bc77a280be1270d"]]},{"id":"390780a76666cd4a","type":"debug","z":"804978a6e5408fa5","name":"debug 442","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":870,"y":1080,"wires":[]},{"id":"7bc77a280be1270d","type":"debug","z":"804978a6e5408fa5","name":"debug 443","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"to","targetType":"msg","statusVal":"","statusType":"auto","x":510,"y":1160,"wires":[]},{"id":"b9e4c57df94197e3","type":"change","z":"804978a6e5408fa5","name":"","rules":[{"t":"set","p":"to","pt":"msg","to":"$.payload[*][*].email","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":1160,"wires":[["390780a76666cd4a"]]},{"id":"fac2f4c6c23d45fd","type":"split","z":"804978a6e5408fa5","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":570,"y":1040,"wires":[["eb37e0d589a8e012"]]},{"id":"eb37e0d589a8e012","type":"join","z":"804978a6e5408fa5","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":";","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":650,"y":1100,"wires":[["b9e4c57df94197e3"]]},{"id":"858e43b95512654b","type":"json","z":"804978a6e5408fa5","name":"","property":"payload","action":"","pretty":true,"x":410,"y":1040,"wires":[["fac2f4c6c23d45fd"]]}]