I am searching for a way to access the "alias" property of fields in Map Viewer pop-ups using Arcade. The following code only returns partial aliases, and looks like it's somehow mixing in field names with their aliases. Any suggestions on how to access the "alias" property in a way that is consistant?
var fieldsToInclude = ["tvd_ft_0",
"well_status_type",
"Symbology",
"tvd_ft_bin_count"
];
var features = FeatureSetByName($map, 'Well Status-20K Grid', fieldsToInclude, false);
var aDict = Schema(features);
var aArray = aDict["fields"];
var output;
for (var i in $feature){
if (!IsEmpty($feature[i]) &&
($feature[i] != 0)) {
for(var j in aArray) {
var dict = aArray[j];
if (dict['name'] == i){
output += dict['alias'] + ": " + $feature[i] + TextFormatting.NewLine + TextFormatting.NewLine;
};
};
};
};
return output;