Failing in creating a JSON when the example I'm following is working

Hi!
I'm following this tutorial on creating a JSON to be later embedded in a mirror.
Here is the code with english translated comments. it works super fine.

When I'm trying to embed a string coming from a telegram bot (and in this example simply injected and passed to a flow level variable) the json I can access browsing the ip-adddress/telegram.json is not populated with my data. How comes?
What am I missing?

The template does not see message or message_time as you have not set them or retieved them from flow context.
Either
set them with a change node before hand or you could use {{flow.message}}

e.g.

[{"id":"cc88641a14c03bc7","type":"http in","z":"30af2d3e.d94ea2","name":"","url":"/telegram.json","method":"get","upload":false,"swaggerDoc":"","x":190,"y":1440,"wires":[["1ad639b1.8b7646"]]},{"id":"1ad639b1.8b7646","type":"change","z":"30af2d3e.d94ea2","name":"","rules":[{"t":"set","p":"message","pt":"msg","to":"message","tot":"flow"},{"t":"set","p":"message_time","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":1440,"wires":[["90a21e3a43bac0c9"]]},{"id":"90a21e3a43bac0c9","type":"template","z":"30af2d3e.d94ea2","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{ \n    \"telegram\": [\n        {\n        \"message\": \"{{message}}\",\n        \"lastUpdate\": \"{{message_time}}\"\n        }\n    ]\n}","output":"str","x":570,"y":1440,"wires":[["344ef76f2d841121"]]},{"id":"344ef76f2d841121","type":"change","z":"30af2d3e.d94ea2","name":"Set Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.content-type","pt":"msg","to":"application/json","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":1440,"wires":[["34e07d0f670651b9"]]},{"id":"34e07d0f670651b9","type":"http response","z":"30af2d3e.d94ea2","name":"","statusCode":"","headers":{},"x":900,"y":1440,"wires":[]}]

ah!
Thanks. Yes. :zipper_mouth_face: :man_facepalming: :pray:

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