Select to view content in your preferred language

Sample attribute rule to enforce subtype domains

974
3
07-17-2022 12:30 PM
Bud
by
Esteemed Contributor

For a table that has a subtype:

Bud_3-1658085291411.png

The subtype fields have domains.

For example, when the ASSET_CLASS subtype value  = 0 (ACTIVE_TRANSPORTATION), the ACTIVITY field uses the ACTIVITY_ATN domain.


Problem:

Just like with regular domains, subtype domains can be easily overridden via the Field Calculator and other mechanisms.

For example, 'asdf' is not a valid ACTIVITY_ATN domain code, but I can still enter that value via the Field Calculator.

Bud_5-1658085692976.png       

         Bud_6-1658086098018.png

Idea:

In ArcGIS, hard-enforcing subtypes and domains isn't supported, and likely won't be supported any time soon.

As a workaround, could Esri provide a sample attribute rule for enforcing subtype domains? (in the Esri Arcade GitHub)

Thanks.

 

3 Comments
HusseinNasser2

I think I wrote a blog when we first introduced `Domain` Arcade function on how to do that. 

 

https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/domain-subtypes-and-the-schema-...

HusseinNasser2_0-1658795273114.png

 

 

The code is subtype agnostic but you should be able to get the Domain at the subtype level by passing the subtype code. 

SSWoodward
Status changed to: Needs Clarification

@Bud 

Did the documentation provided by @HusseinNasser2 help you get to a solution here?

Bud
by

@SSWoodward 

The short answer is: I'm not good enough with Arcade code to get that working for subtype domains.

It would be ideal to have a sample script that is specifically for enforcing a domain that comes from a subtype.