Access a payload property by using a string variable

Use RED.util.getObjectProperty

See similar thread here : Alternatives to eval() - #2 by Steve-Mcl

in your case...

var i = 1; // <<get from somewhere else. Hard coded to 1 for demo purposes
var varName = `section_${i}`
var v = RED.util.getObjectProperty(msg.payload, varName); 
1 Like