Select to view content in your preferred language

Domain Field Returning Non-Domain Values

2109
17
Jump to solution
04-19-2023 03:57 PM
minhomo28
Emerging Contributor

Hi, 

I currently have a field with domain applied to it. I copied over bunch of values to the domain field using field calculator. My expectation was that the domain will exclude all the non - domain values ( Null) and keep only the values that are in the domain list. Apparently, it is not happening. Non - domain values are still showing in the domain field.  Does anyone know how this could be fixed? 

Thanks. 

0 Kudos
17 Replies
JoshuaSharp-Heward
Frequent Contributor

Hi,

It needs to match the 'code' not the 'description', as the code is what's stored in the database and the description is what it's shown as. That'll be why it's failing for you.

0 Kudos
minhomo28
Emerging Contributor

I think that will make the drop down of code values , not description values. For example, the drop down list of domain field will give a list of Code 1 , Code2, Code3 .... instead of giving PRV1, PRV2, PRV3. 

Or am I misunderstanding how domain works? 

0 Kudos
JoshuaSharp-Heward
Frequent Contributor

The code is what's stored in the db and the description is what's shown. If you try to enter the description into the database it won't recognise it as a valid option. When digitising information in pro it will present you the description in the drop down but store the code behind the scenes. You can see that in action by switching off "show domain and subtype descriptions" check box in the attribute table.

So to successfully populate that data over you will have to find a way of converting those "description" values to their respective codes, I'd personally use a dictionary as a lookup table.

0 Kudos
minhomo28
Emerging Contributor

Ah you are absolutely right. Thank you so much for the help! 

 

0 Kudos
JoshuaSharp-Heward
Frequent Contributor

No worries 🙂 glad I could help out! Do you want to mark this as solved so people know we've got a resolution?

0 Kudos
minhomo28
Emerging Contributor

Will do . Thanks again! 

0 Kudos
Robert_LeClair
Esri Notable Contributor

In reviewing the screen grab of the error message thrown in the tool, I found this link here regarding the description of the error and the solution.  Are you doing any field  mapping at all?

0 Kudos
minhomo28
Emerging Contributor

I am just using Field Calculator to move data to domain field. 

0 Kudos