Hello,
I'm trying to use Arcade to return the field aliases of fields that have a value of "1" in the data. I have a table of fish species and I would like to return the field alias in the popup anytime there is a value of "1" found in the species record (image of table below). I currently have an Arcade expression that returns all of the field aliases if a "1" is found in the data, but I would like to specify the fields to return.
Expression I have so far that returns all:
var features = FeatureSetByName($map, 'Ocean Prime Fishing Grounds', ['*'], false);
var aDict = Schema(features);
var aArray = aDict["fields"];
var output;
for (var i in $feature){
if ($feature[i] == 1) {
for(var j in aArray) {
var dict = aArray[j];
if (dict['name'] == i){
output += dict['alias'] + TextFormatting.NewLine;
}
}
}
}
return output;
Here are the specific fields I would like to return:
'SUMMFLOUND', 'SEABASSTAU', 'CODPOLLOCK', 'BLUEFISH', 'WEAKFISH', 'STRIPEDBAS', 'TUNA', 'SHARKS', 'BILLFISH', 'BONITOALBA', 'SCUP', 'RED_HAKE', 'LOBSTER'
Example of the data table:

The data I'm using is shared publicly - https://njdep.maps.arcgis.com/home/item.html?id=df7de8c132a749d680ae415b30322fc8
Any help is appreciated. Thanks.