1

I have a table with a bunch of domains, and a table with the information needed to populate the domains. I joined the two, but the table of information is populated as text.

I need to be able to change the domains to what the information table has.

I have checked and the domains and the information table have the same number of selections.

Is there a way in the field calculator using python to select and change the coded value?

so if I have 3 choices :

shapefile domains:

1 A

2 B

3 C

information table:

A

B

C

Is there a script that would change A to 1 B to 2 C to 3 and have the domains change?

3

Esri provides an option,How To: Apply domain values to a field using the Field Calculator, to input "to apply a coded value domain to a field within a feature class using the Field Calculator."

In this scenario, it is assumed that a domain has already been applied to the field to which assign values to. The domain has the following attributes:

Domain Name: Color
Field Type: Long Integer
Domain Type: Coded Values

Domain Values
Code:0 Description: Blue
Code:1 Description: Red
Code:2 Description: Green

The steps outlined are the following:

Open attribute table of feature class.
Highlight the records to apply coded value domain descriptions to.
Right-click the field name that the domain (Color) is applied to, and click Field Calculator.
Input the coded value that matches the desired description.

For instance, if it is necessary for all values to be 'Red', input '1' and select OK. This is because the coded value assigned to 'Red' in the domain is '1'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.