Extracting text from object using mustache template

[{"id":"f9a5770faf447e4d","type":"inject","z":"400bc99efba52b23","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"Text\":\"SP-4 is Running Since 17 Min\"},{\"Text\":\"Juice Line is Running Since 9 Min\"},{\"Text\":\"14 Track is Running Since 9 Min\"},{\"Text\":\"New 8 Track is Running Since 4 Min\"},{\"Text\":\"AP-2 is Running Since 1 Min\"},{\"Text\":\"Mespack-2 is Running Since 155 Min\"},{\"Text\":\"Vardaan is Running Since 81 Min\"}]","payloadType":"json","x":3840,"y":1200,"wires":[["33e60c1e608595c5","5f5dd1deb2c5a86f"]]},{"id":"5f5dd1deb2c5a86f","type":"template","z":"400bc99efba52b23","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload[0].Text}}\n{{payload[1].Text}}\n{{payload[2].Text}}\n{{payload[3].Text}}\n{{payload[4].Text}}\n{{payload[5].Text}}\n{{payload[6].Text}}","output":"str","x":4050,"y":1200,"wires":[["b4431937280518bb"]]},{"id":"b4431937280518bb","type":"debug","z":"400bc99efba52b23","name":"debug 388","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":4220,"y":1200,"wires":[]}]

i am trying to extract only one element from an array of objects. but this seems not working. what is the mistake i am doing ?

this is my template node

image

image

i am expecting to get result like this
image

FYI: This has been asked and answered many many times already

Dont use [x], use .x. instead

{{payload.0.Text}}
{{payload.1.Text}}
{{payload.2.Text}}
{{payload.?.Text}}
and so on

Even better:

{{#payload}}
     {{Text}
{{/payload}}
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.