How to get an array value from flow context

Hi,
I wsa trying to get a particular array value from the flow context, but i could only get the whole values in the array instead of a particular value.

I was using

msg.payload = flow.get("testCheck",[0]);

to get the value but no hope.
Any help is appreciated. Thanks in advance

Inkedwfica32_AGnEQefxwZ

flow.get accepts a single argument, the variable.
The variable contains an array and you want the first element:

const myFlowVariable = flow.get("testCheck")
msg.payload = myFlowVariable[0]

// or if you want the short version:

msg.payload = flow.get("testCheck")[0]
1 Like

Thanks for the quick reply @bakman2

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