Recalculate field

400
2
02-28-2022 06:27 AM
Bryan_Wade
Occasional Contributor

I have a survey that I recently updated. One of the questions has 2 answers "Submitted" and "Reviewed". After the update, the survey is showing a new submitted and reviewed option in the field. I was told that I need to recalculate the field so that all the answers appear the same on the map. How do I go about doing this?

2 Replies
DerrickWestoby
Occasional Contributor III

I'm not sure I fully understand your question, but I'll try answering based on my understanding of it. 

You're just saying that "Submitted" has become "submitted" and "Reviewed" has become "reviewed", correct? 

A critical part to understand here is that your S123 options that draw from a list (domain) like this have a name/code value and a human-readable "label" value.      For instance, a Label of "Bald Eagle" might have a name/code like "bald_eagle". 

Another thing to know is that the name/code and label values work as expected when you FIRST publish a survey, but if you updated the options in  your choice list at a later date, the labels are not copied over and you have to update these manually. 

Here's an example.  This is the list, or domain, for my "Component" question, which I'm viewing in the AGOL feature layer data-> fields page for the component question.   All of the list options here are created from my list that's stored in the Survey123 XLS when I first published it.  The "Pipe" option, however, was added to the list after initial publishing and the "Label" was not copied over for this reason.  If I displayed this in a web map or printed out these options in a Survey123 feature report, the "Label" column is going to be what's displayed and "pipe" is the only one that wouldn't be capitalized because of what you're seeing here. 

DerrickWestoby_0-1646243838041.png

Assuming this is the issue you're trying to resolve, fix it by manually fixing the "Label" value in your Feature Layer's Data page by editing the list for that specific question. 

 

Aside from that, I'm guessing that you may now have a feature layer with a mishmash of values that should be the same?  IE:  Features that should be marked as "Reviewed" might be "Reviewed" or "reviewed", resulting in a legend with 4x classes instead of two? 

If that's the case, you could fix it with "Calculate Field", using Arcade, also from the feature layer's data page.   That is doable, but maybe a little more complicated if you haven't used Arcade much.  You could just manually correct each feature after updating your list option, if you have a small amount of features.   If you still need to use Arcade to fix this issue, just reply here and we should be able to get it sorted out for you.  I don't want to type out a long response to that if it's not an issue you're facing anyways. 

Here's a quick example though:

DerrickWestoby_1-1646244111355.png

 

DerrickWestoby_2-1646244190859.png

 



0 Kudos
Bryan_Wade
Occasional Contributor

Derrick,

Thank you for the response. I went and manually changed the fields but what you described here

"

Aside from that, I'm guessing that you may now have a feature layer with a mishmash of values that should be the same?  IE:  Features that should be marked as "Reviewed" might be "Reviewed" or "reviewed", resulting in a legend with 4x classes instead of two? 

If that's the case, you could fix it with "Calculate Field", using Arcade, also from the feature layer's data page.   That is doable, but maybe a little more complicated if you haven't used Arcade much.  You could just manually correct each feature after updating your list option, if you have a small amount of features.   If you still need to use Arcade to fix this issue, just reply here and we should be able to get it sorted out for you.  I don't want to type out a long response to that if it's not an issue you're facing anyways. " 

is what I am running into now. I haven't really used arcade at all so any information you can share would be greatly apprecaited. 

0 Kudos