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).
Solved! Go to Solution.
Expects is more critical when the Arcade expression is used in Visualization and Labeling. From the documentation:
In some profiles, such as Visualization and Labeling, apps only request the data attributes required for rendering each feature or label.
You're getting the list of fields from the feature, which will contain all fields in the Popup profile. You can put some logic in there to skip fields you don't want to include
for(var field in $feature){
if (field != 'Parking'){
if($feature[field] == "Yes"){
for(var s in sch.fields){
if(sch.fields[s].name == field){
Push(Yes, sch.fields[s].alias);
break;
}
}
}
}
}
Expects is more critical when the Arcade expression is used in Visualization and Labeling. From the documentation:
In some profiles, such as Visualization and Labeling, apps only request the data attributes required for rendering each feature or label.
You're getting the list of fields from the feature, which will contain all fields in the Popup profile. You can put some logic in there to skip fields you don't want to include
for(var field in $feature){
if (field != 'Parking'){
if($feature[field] == "Yes"){
for(var s in sch.fields){
if(sch.fields[s].name == field){
Push(Yes, sch.fields[s].alias);
break;
}
}
}
}
}
Thank-you, that worked perfectly!