Changing field values in ArcGIS Online

628
3
Jump to solution
02-18-2019 02:13 PM
Katie_Clark
MVP Regular Contributor

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!

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
1 Solution

Accepted Solutions
AdrianWelsh
MVP Honored Contributor

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: 

Domains view—Geodatabases | ArcGIS Desktop 

View solution in original post

3 Replies
AdrianWelsh
MVP Honored Contributor

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: 

Domains view—Geodatabases | ArcGIS Desktop 

Katie_Clark
MVP Regular Contributor

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!

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
AdrianWelsh
MVP Honored Contributor

No problem, and I'm glad to hear it worked!

0 Kudos