I'm looking for a way to construct a field name in Arcade and retrieve its value. Say you have a hosted feature layer with an attribute field named after each day of the week. I can construct the field name as "$feature.insertDayHere" but that is just a string that I need to evaluate to get the value. Does Arcade have any kind of EVAL function?
html = '<html table header stuff>';
var daynames = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
for (var d in daynames) {
var fieldname = '$feature.' + d;
html += '<tr>' + d + ': ' + fieldname + '</tr>';
}