Web App (Map viewer) symbology not updating with new Survey123 results

414
2
05-15-2023 03:43 PM
Labels (2)
cole_KTB
New Contributor III

Hey can anyone help with an issue I am having in my Web map/app? 

I have a web map that has a few layers, one of which is pulling data from a live survey123 form. I made an Arcade Expression to categorize symbology from a select multiple question in the form. This worked perfectly, but only 3/5 options had been selected in the survey so the legend/symbology didn't include those. Now the two missing options have been selected (by me for a test) and the symbology does not update. 

I have tried removing the layer, expression, rewriting etc. but nothing seems to fix it. And when I delete/reupload the code it actually excludes more of the question options....? 

Here is the code I used for symbology: 

var a = $feature.plant_id;
if(a == 'eurasian'){
  return "Eurasian watermilfoil"
} else if (a == 'pondweed'){
  return "Curlyleaf pondweed"
} else if (a == 'pondweed,eurasian'){
  return "Both"
} else if (a == 'eurasain,pondweed'){
  return "Both"
  } else {
  return "Neither (absence)"
}
All options of the question have been selected, but only "Eurasian watermilfoil" and "Neither" is displaying now. It is as if it does not recognize the new data. And I checked to make sure the layer on a separate map was getting the new points from the survey. 
0 Kudos
2 Replies
RhettZufelt
MVP Notable Contributor

Not quite sure what you are asking,  but using Arcade to modify symbology has some issues (at least with unique values), so I'm going to guess that yours is related to this:

Seems Arcade symbology with unique values will only populate the symbolgy with values that currently exist when the symbology is applied, and sometimes not even that.

What happens if you turn on "Other" (green arrow)?  If that shows the missing symbols, then probably just need to set up the symbology for ALL  the other return values as well ("Both", "Eurasian watermilfoil", etc.).

If the "Other" options show the missing values, then you will want to "Add" the other values to the list.

RhettZufelt_0-1684193134138.png

Another method that is sometimes easier is to add all possible combinations of the return data (symbol values) to features in the dataset.  Then, when you apply the symbology from Arcade, they will all get populated, then just delete the "temp" features from the feature class.

R_

cole_KTB
New Contributor III

Thank you for the response & help! Sorry, my question was basically just asking if anyone knew why the arcade expression would not include new responses from questions and how to fix the code if there was an issue. 

I ended up having to start a new Web Map and starting over, as you suggested with all the options of the questions selected (by me). This ended up working out with a few minor errors that I am not too worried about.  

0 Kudos