Here is my problem, I can't get the value of msg.index, tried moustache, @$, eval(), and some others, the variable is always declared with the literal content of the edit,
you could use [ ] notation, but it only works on a named property of the context in the change node (node-red > 1.3).
e.g global.foo[msg.index] would work
but global.[msg.index] does not.
you can do global.set(msg.index, msd.payload);
in a function node, if you can not work with an extra depth to your global vars.
In short, based on what @E1cid mentioned above. You can use a code like below inside a function node. You pass a json object inside msg.payload ang get as result a set of global variables created.
let pay = msg.payload;
for (let prop in pay) {
global.set(prop, pay[prop])
}
return msg;
sharing a thought... it would be useful on the change node to allow dynamic var naming. The documentation discourages you to use coded interactions, unavoidable in this particular case.