I'm starting learning node-red for an Arduino project. I have an MQTT node that receives the TTN (The Things Network) data, another one that send messages to Telegram (using a bot) with the information of the previous function. The Arduino project I said send the GPS data to TTN every some seconds.
The issue, I have, is because I don't know who to format the TTN payload to use it as a location message in the Telegram node. I add a photo of my flow.
I already send a location to Telegram, but my problem is sending the location received by TTN. I add the path for "latitude" and "longitude" variables:
in a function node, the incomming data is ALWAYS contained in the msg object
therefore, you should use msg.payload.x.y.z
Also, since the values you want are in odd named variables, you will need to use square bracket notation to access them - OR - use the tools provided (i.e. copy the EXACT path without mistake) see below...
There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.
Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.