Hi, I am trying to export features from a geodatabase with all fields containing domains as text descriptions instead of coded values (because I need to integrate this with other datasets that use different codes for the same values; and because I would like to use tools such as Union which don't have the option to preserve domains).
I have found a solution by using the "Feature class to feature class" tool - when I tick "Transfer field domain descriptions" in the environments for this tool, it makes a copy of the domains as text descriptions (in new fields with d_ as a prefix to their titles) as well as preserving the domains for the coded columns. Ticking the same box in the environment for Export Features does not produce a copy of the domains as text, it just preserves the connection the domains. But there is a note in the Feature Class to Feature Class tool saying that it is going to be removed in future versions. How are you going to allow people to keep domains, (without having to do table joins and manually update them every time, which is several additional steps)?
Please can you allow the option to create a domains-as-text field when exporting features?
And, ideally, can we have the option to preserve domains when running Union and Intersect queries as well.
You can add a new text field to hold the descriptions and use the following arcade expression from field calculator. It will return the domain descriptions for the domain assigned to the "Field-Name".
DomainName($feature, 'Field-Name')
Thanks, that is helpful. It would still be useful and efficient to have adding and updating the domains-as-text fields as a single step integrated with exporting a copy or running a query - especially in situations where there are several fields with domains so that even identifying them all to add to a code takes a bit of messing about.
Yes ... that would have been helpful.
I think this would be better as an idea, not a question: https://community.esri.com/t5/arcgis-pro-ideas/idb-p/arcgis-pro-ideas
You can either create a new idea. Or ask a moderator to convert this question to an idea:
basically, looks like it's a bug with Export Features. Which has been there for years. in fact it's been there so long there are posts dating back to early ArcMap 10.x days. Probably the same code.
Basically, this (Problem: Coded Value Domain Descriptions Are Not Included When Exporting Data in ArcGIS Pr) doesn't work. Since 99% of customers probably use domains, hope this gets fixed some day. Still broken in 3.4.
I agree, the only solution I found is using arcpy.conversion.FeatureClassToFeatureClass with proper environment settings, since the toolbox has been deprecated in Pro 3.3.
I hope Esri will fix it soon...