Select to view content in your preferred language

Is there a way to update a domain, when a Feature Class is updated?

2740
5
02-19-2019 08:55 AM
CharlesQuadrini
Emerging Contributor

I have create a Feature class, of shape polyline. I have then used the geoprocessing tool "Table to Domain" to take this list of polylines and allow it to be consumed by another table or feature class in my gdb as a domain value.

The challenge I now have, is when a new polyline is added to the original or source feature class, how do I get the domain to update with this new value? Is there a setting I forgot to check when creating the domain originally? A python script I need to write? Workflow manager? Or just not doable?

Thanks,

Charles

0 Kudos
5 Replies
ChristianWells
Esri Regular Contributor

Charles Quadrini‌ this should be possible through the field settings if you are looking for the fields to automatically populate upon creation. Associating default values and domains with tables and feature classes—ArcGIS Help | ArcGIS Desktop 

After re-reading your question, I wasn't sure if you are looking for the field to be updated automatically or the domain list to be updated automatically?

0 Kudos
CharlesQuadrini
Emerging Contributor

Hi Christian,

I am looking for the domain to be updated automatically when a new row is added to the feature class by drawing a new polyline.

Is that clearer?

Charles

0 Kudos
ChristianWells
Esri Regular Contributor

That helps to clarify, however, I don't know of a way to make it automatically update domain without running a script to check for new values and update the domain as needed. Once the 'Table to Domain' tool is ran, the Geodatabase stores the values as metadata and is no longer connected to the original table/feature class used to create the domain. 

If you're looking for an automated method, one way could be to set up a Python file through Windows Task Scheduler. You could have it run during off hours to avoid creating Geodatabase locks. Here's a breakdown of how you could do this via Python:

  1. Connect to the Geodatabase and query the domain using the 'Domain to Table' tool
    1. Domain To Table—Data Management toolbox | ArcGIS Desktop 
  2. Find all of the current values in the domain and store as a Python list or iterate through the rows
    1. SearchCursor—Help | ArcGIS Desktop 
  3. Connect to the polyline table and query the field used by the domain
  4. Find all of the current values in the field and store as a Python list
    1. SearchCursor—Help | ArcGIS Desktop 
  5. Compare the lists via Python and find the new values from the polyline
  6. Use the appropriate (Coded Value vs Range) geoprocessing tool to update the domain values
    1. Add Coded Value To Domain—Data Management toolbox | ArcGIS Desktop 
    2. Set Value For Range Domain—Data Management toolbox | ArcGIS Desktop 

I hope you find this helpful.

TamerAssaf
Occasional Contributor

Hi @CharlesQuadrini  , 

Did you find the solution?
If you find the solution, what is the solution?

0 Kudos
Bud
by
Esteemed Contributor

This isn’t my area of expertise, but you could look into web hooks.

What kind of geodatabase? If you are using an enterprise GDB (or maybe a mobile GDB) the you could query using SQL to compare the FC values against the domain values. But you’d still need to use most of @ChristianWells steps above, like a scheduled task and Python to insert a new value into the domain.

Related ideas: