I have a flow scoped array that I initialized like this:
Later on, I'm doing some processing to figure out which element of that array I want to make a change to. So I can do this if I want to change element  of that array.
That works fine. But I actually want to use a variable instead of hard coding in the index value, so more like this:
But node-red throws an error when I use a variable "index_match".
function : (error)"Error: Invalid property expression: unexpected i at position 7"
I can can kinda see why, a variable inside the single quotes is weird. Is there some other syntax for addressing an element of a flow scoped array? I'd rather not have to resort to this ugliness:
if (index_match == 0) flow.set('status', msg.payload); else if (index_match == 1) flow.set('status', msg.payload); else if (index_match == 2) flow.set('status', msg.payload);
Edit: I also tried this syntax with the index outside the quotes.
This runs, but doesn't actually change the array element, so doesn't do what I'm intending.