Hi all,
I'm fairly new to Node-Red, so please forgive me incorrectly naming things if I do...
I'm trying to use Node-Red to pull data from a Corona API and push this to a telegram bot.
I have managed to set up the Telegram Bot but am struggling with the data from the API.
The msg.payload for the daily cases is added in an array (I think). I assume it's an array because it says array[494]
in the right pane.
So currently we are sitting on payload.National.Cases[493]
, yesterday was payload.National.Cases[492]
.
I'm trying to use a Template Node to use payload.National.Cases[x]
where x is the largest number which should give me the latest data. How do I do this and with what nodes??
It's not only the payload.National.Cases
that I will be using, but all of the objects have the same arrays, so if I can get this one correct, I can apply this logic to the other objects.
Thanks in advance everyone!
Stay safe out there!!