Arcade Expression stopped running in pop-up

410
2
05-02-2025 01:57 PM
Labels (1)
JenniferBorlick
Frequent Contributor

I have an Arcade Expression that has decided to stop working. I was using FeatureSetByName and it stopped running when I changed the layer name. I changed it to FeatureSetByID and it still doesn't work. Set it back to FeatureSetByName and used the new name. Still doesn't work. This is what's weird.

When I am configuring the pop-up, it shows up in the pop-up.

JenniferBorlick_0-1746219155296.png

When I click on a feature, it doesn't.

JenniferBorlick_1-1746219195050.png

I even tried adding it as an expression in the table. Same results. It shows up in the configuration, but not in the pop-up.
The frustrating part is that it used to work.
Anybody have any ideas.

var fields = ["Baseball_Softball", "Benches", "Biking_Trails", "Birding_Wildlife_Viewing", "Boat_Launch", "Cross_Country_Skiing", "Drinking_Water","Enclosed_Shelter","Equestrian_Trails", "Fishing", "Grills","Historical_Area", "Mulitple_Gender_based_Restrooms","Natural_Study_Area","Non_Motorized_Boating","Open_Shelter","Paved_MultiUse_Trails", "Picnic_Tables","Play_Fields_Open", "Rest_Room", "Single_Unisex_Restroom", "Sledding_Area", "State_Natural_Area","Trail_Shelter", "Unpaved_Hiking_Trails"];

var features = FeatureSetById($map, "1963b1ca2de-layer-23", fields, false);

var aDict = Schema(features);

var aArray = aDict['fields'];

var output;

for (var j in aArray) {

    //console(aArray[j]['name'] + ' ' + $feature[aArray[j]['name']])

    if ($feature[aArray[j]['name']] == 'Yes') {$map

        output += aArray[j]['alias'] + TextFormatting.NewLine;

    }

}

return output;
0 Kudos
2 Replies
JenniferBorlick
Frequent Contributor

Got some help. I had an errant 

 $map

in there.

 

JenniferBorlick
Frequent Contributor

OK. That wasn't it. What I have determined is the factor is if I had the Fields Block with the fields in it, this script (and another one that someone gave me) work. If I don't have the fields list in there it doesn't. Which to me seems counterintuitive.

 

0 Kudos