How do i use a variable in global.get ? i.e. global.get(variablename)

I have wrote a funtion that i want to use multiple times.

I need to do a global.get but instead of the usual global.get("xxxxx") where you specify the specific you want to lookup, i want to use a variable for the value to be looked up. (This will be passed to the function)

TheVariable = msg.variable
GlobalVal = global.get(TheVariable)

Please can anyone help?

Is this possible ?

let TheVariable = msg.variable;
let GlobalVal = global.get(TheVariable);

I think you answered your own question, did you try it?

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