Select to view content in your preferred language

Prevent non-domain values from being used (across the board, including GP tools)

990
7
06-23-2022 11:53 AM
Status: Open
Labels (1)
Bud
by
Honored Contributor

Scenario:
We have a coded value domain on a field. A user overrides the domain by using the field calculator or some other method. Now, there are invalid values in that field.

Idea:
Give us an optional setting in the table properties to "hard enforce" domains. (The setting could be disabled by default to avoid causing confusion in existing workflows.) All ArcGIS functionality/applications would be designed to honor the domain and prevent invalid values from being entered.

I’m aware similar functionality can be achieved via customization using attribute rules or database triggers. But we shouldn't need to write custom code to enforce a pick list. Most enterprise systems have hard domains built in as a way of enforcing basic data integrity. For example, in IBM Maximo, the entire system honors domains by default — including back-end Python scripts. As a result, data integrity is rock solid, making data analysis easy.

Could that same functionality be added to ArcGIS across the board, including GP tools?

Tags (2)
7 Comments
Scott_Harris

FYI @Bud  Attributes pane editing has functionality for finding and preventing invalid attributes, including invalid domains.

See these help pages for more information:
https://pro.arcgis.com/en/pro-app/latest/help/editing/edit-feature-attributes.htm#ESRI_SECTION1_8F13...

https://pro.arcgis.com/en/pro-app/latest/help/editing/change-general-editing-tool-settings.htm

It sounds like your idea might be more specific to Geoprocessing, so I updated the label to reflect that.

KoryKramer

@Bud we have this idea on the books and are tracking it in terms of the geoprocessing tool UI https://community.esri.com/t5/arcgis-pro-ideas/field-calculator-should-honor-domains/idi-p/928220 

After some internal discussion, if the intent is to block writing any value outside of a domain to the database, that could be set up using constraint attribute rules: https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/constraint-attribute-rules.... 

Note that the Calculate Field gp tool does have an Enforce Domains parameter, but it is off by default because it is an expensive operation in terms of performance and is a different pattern than what users may have been used to. So the idea I pointed to is about providing the domain picklist in the tool's UI.

Bud
by

Thanks Kory.

And @Scott_Harris, regarding this link:

https://pro.arcgis.com/en/pro-app/latest/help/editing/edit-feature-attributes.htm#ESRI_SECTION1_8F13...

Find and correct invalid values

To find and correct invalid attribute values, right-click the layer in the selection view and click Select Only Invalid Objects Select Only Invalid Objects. This command is available with layers for which a data rule exists including attribute rules and other geodatabase behaviors such as attribute domains.

Bud_1-1656081009894.png

That looks helpful. Thanks.
For my notes, that functionality doesn't seem to be available in ArcGIS Pro 2.6.8:

https://pro.arcgis.com/en/pro-app/2.6/help/editing/edit-feature-attributes.htm

Bud_2-1656081148196.png

 

Scott_Harris

@Bud The functionality was added at 2.6.

Try this:

  1. From the menu you are on, click 'Select All' to select all features in the layer.
  2. From the Attributes pane, right click on that layer's 'node' in the selection tree.
  3. Choose 'Select Only Invalid Objects'  (in 2.6 this may have said 'Select Only Invalid Features'). This command will remove the features with valid attributes from the selection and leave only the features with invalid attributes selected.Scott_Harris_0-1656082474937.png
  4. From there, you can correct these individually on the feature node, or in bulk if you have the layer node highlighted when updating attributes.
  5. Once you fix a few, run the command again to remove the features with valid attributes from the selection.
Bud
by

@Scott_Harris Thanks. As you might have guessed, I was looking at the Attributes Table (incorrect), not the Attributes Pane (correct).

For what it's worth, that technique worked fine on a feature class, but I couldn't get it to work for a non-spatial table. I'm not sure why. I deliberately entered an invalid domain value (via the field calculator), but the "Select Only Invalid Objects" functionality didn't select that record (or any other invalid domain records). 

Does it work for you when used on a non-spatial table in a newer version of Pro?

Scott_Harris

@Bud 2.8 and higher allow the command to work with standalone tables

RhettZufelt

Would be nice if this worked for hosted feature layers.

 

R_