How do I change an existing value of a coded value domain?

181
1
Jump to solution
05-20-2020 09:53 AM
ShawnHolyoak1
New Contributor

I have a coded value domain that I need to change one of the entries from the text "Medium" to "Moderate". This domain is used in two feature classes and several fields in those feature classes. I need to make the change while also changing the value of the fields in the row in the feature classes that have the old value. In other words, I need to change the domain and change the values in the feature classes while not breaking the linkage between the domain and feature classes. I would like to do this via arcpy, but I don't see the tools to do it. I can export the domain to a table, change the values in the table, and recreate the domain from the updated table, and then assign that domain to each feature class, but I don't believe that will change the existing row values. Any suggestions for how to solve this?

0 Kudos
1 Solution

Accepted Solutions
RandyBurton
MVP Regular Contributor

Check out the examples using the Domains toolset (ArcMap) or  Pro.

Specifically look at code for Delete Coded Value To Domain and Add Coded value to Domain.  Delete the old value, add the new value.  There is a tool to resort the the domain which may be of benefit, particularly when using tools like Collector.

If  you are not changing the code (just the description), you probably shouldn't have to change your data.  If you do need to change your data, you could use an update cursor and a where statement (where field using domain equals the code value being replaced).  Alternatively, you could use the Field Calculator.

View solution in original post

1 Reply
RandyBurton
MVP Regular Contributor

Check out the examples using the Domains toolset (ArcMap) or  Pro.

Specifically look at code for Delete Coded Value To Domain and Add Coded value to Domain.  Delete the old value, add the new value.  There is a tool to resort the the domain which may be of benefit, particularly when using tools like Collector.

If  you are not changing the code (just the description), you probably shouldn't have to change your data.  If you do need to change your data, you could use an update cursor and a where statement (where field using domain equals the code value being replaced).  Alternatively, you could use the Field Calculator.