I am having issue with using an Arcade expression for a Pop-up. The end goal is to only show a list of Field Name Alias that are equal to "Yes" for a select set of fields (not all the fields).
Expects($feature, "ADA", "Amphitheater", "Baseball", "Basketball", "BattingCage", "Beach", "BoatRamp", "Boating", "Clubhouse", "CommunityCenter", "Concessions", "Cornhole", "DiscGolf", "DogPark", "Equestrian", "Fishing", "FitnessPavillion", "Football", "Fountain", "Garden", "Gazebo", "Golf", "Greenway", "GreenSpace", "Gym", "Horseshoe", "Kitchen", "Lake", "LittleLeague", "Paddle", "PaddleCraft", "PicnicArea", "PicnicPad", "PicnicTables", "Pickleball", "Pier", "PingPong", "Pool", "PumpTrack", "RecreationCenter", "Restrooms", "Shelters", "Skateboard", "Soccer", "Softball", "SplashPad", "Swim", "Tennis", "Track", "Trails", "Volleyball", "Walkway")
var sch = Schema($feature)
var Yes =[]
for(var field in $feature){
if($feature[field] == "Yes"){
for(var s in sch.fields){
if(sch.fields[s].name == field){
Push(Yes, sch.fields[s].alias);
break;
}
}
}
}
return Concatenate(Yes, "\n") + TextFormatting.NewLine + $feature.Other
The issue I am having is that the result shows "Parking", even though Parking is not in the list of Field Names.