Template Node (array integration)

Hi all,

Having trouble grabbing values from an array using the template node. I did some skimming on google but didn't find a real clear answer. Seen a bunch of "Attach it to a debug node and look for the results..."

This is what is coming out of my join node as an array:

{"_msgid":"21936ce2.9c0954","topic":"","payload":["2019-08-19T23:00:00-05:00","2019-08-20T24:00:00-05:00"]}

However when passing it to a template node:
Template Node code:

start={{payload.[1]}}

Template Node Output:

{"_msgid":"21936ce2.9c0954","topic":"","payload":"start="}

I do something similar with a function node and get the expected result. I prefer to use the template node for simplicity if possible. If not, not a biggie.

Thanks, Matt

1 Like

Try

start={{payload.1}}

-- Mike

3 Likes

@mike Does the template node prefer JSONanata like syntax for accessing elements? :thinking: Didn’t know that trick, thanks

No. Its mustache syntax in the template node

2 Likes

Thanks Mike.

1 Like