I have a hosted feature service of county boundaries within a web map: https://fgio.maps.arcgis.com/apps/mapviewer/index.html?webmap=c6d86a156e80458e8d4104d20c3900dc
The feature service has several fields, each containing only Yes/No values. I want to stylize the layer by getting a count of how many instances of 'YES' there are across all attributes for each record. I wrote an Arcade expression within the Styles panel that correctly returns the number of instances as an integer. I also applied this expression to the pop-up, and can see the expected results for each feature when I click it. However, when I go to actually style the layer (Counts and Amounts (color) for example), the map won't draw using the results of the Arcade expression. It doesn't draw anything at all, or instead lumps everything into 'Other' if I toggle on that option. I have shared the map publicly so that the expression and setup can be viewed.
I'm not sure if I'm running into an undocumented limitation or what. I have been scouring forums and have seen many examples that are powering a style with an integer returned by an expression, but I haven't been able to pinpoint why mine is failing. Any ideas?
var fieldList = ['Dorian_2019','Sally_2020','Ian_2022','Nicole_2022','Idalia_2023']
var total = 0
for (var f in fieldList) {
If ($feature[fieldList[f]] == 'YES') {
total += 1
}
}
return total
This spits out a simple integer. All of the results are between 0 and 4.
