Hello,
I have published a feature service hosted in ArcGIS Online that has a field ("musym") with soil symbol codes. (i.e. 11A, 13B, 23C). In a PDF, I have the key for this data. (i.e. 11A = "Leaksville silt loam"). What I want to do is either change the data in this field, or create a new field that will fill in with the correct "translation" so it can be read and understood by people in the field.
I'm sure something like this can be done with either SQL or Arcade, but I'm having a bit of trouble figuring out how. I am most familiar with Python syntax, so switching between all of these languages has me a bit mixed up. I was trying to do something along the lines of this (keep in mind, I'm sure the syntax isn't right, I'm just trying to illustrate the logic).
if $feature.musym == '11A'
$feature.musym = 'Leaksville silt loam'
else if $feature.musym == '13B'
$feature.musym = 'Mayodan fine sandy loam'
else if.....
etc
Ultimately I want to be able to symbolize based on this information and display the soil type in a pop up.
Does anyone have any ideas of how to approach this? I'm very new to writing code (in any language) so any ideas are appreciated. Thanks!
Solved! Go to Solution.
Katherine,
This sounds like a perfect opportunity to use a coded domain in your values. You can easily create this as a new field in AGOL:
Define attribute lists and ranges—ArcGIS Online Help | ArcGIS
Or, you can create it at the desktop level as well:
Katherine,
This sounds like a perfect opportunity to use a coded domain in your values. You can easily create this as a new field in AGOL:
Define attribute lists and ranges—ArcGIS Online Help | ArcGIS
Or, you can create it at the desktop level as well:
Thank you for the quick reply, Adrian! I've used domains before in order to have drop down options in a pop-up, but never thought to use it to re-code and calculate a new field. Learning something new every day.
Anyway, it worked great for my situation. Just added the domains with the appropriate label (soil description) and code (value from "musym"), and when I calculated the new field to be equal to the "musym" field, it displayed with the domain label.
Again, thank you!
No problem, and I'm glad to hear it worked!