How to list existing Attribute Rules?

855
2
Jump to solution
06-07-2024 08:50 AM
Brian_Wilson
Honored Contributor

I wrote a script that exports rules from each feature class in a database, but it creates files even when a feature class has no rules.

I need to be able to tell if there are rules attached to a feature class, like ListFeatureClasses or ListDomains

There are methods Add and Alter rules but you have to know the name of a rule to do those operatoins.

How can I list??

 

0 Kudos
1 Solution

Accepted Solutions
Brian_Wilson
Honored Contributor

I found this old post in ArcGIS Pro by @JakeSkinner 

https://community.esri.com/t5/arcgis-pro-questions/iterate-through-sde-to-find-and-export-fcs-with/t...

Seems I commented on it 2 years ago too!!

Short answer, there is an undocumented property when you do "Describe"

        rules = arcpy.Describe(fc).attributeRules

 

It returns a list of rules or an empty list of there are none defined on that feature class.

View solution in original post

2 Replies
Brian_Wilson
Honored Contributor

I found this old post in ArcGIS Pro by @JakeSkinner 

https://community.esri.com/t5/arcgis-pro-questions/iterate-through-sde-to-find-and-export-fcs-with/t...

Seems I commented on it 2 years ago too!!

Short answer, there is an undocumented property when you do "Describe"

        rules = arcpy.Describe(fc).attributeRules

 

It returns a list of rules or an empty list of there are none defined on that feature class.

SSWoodward
Esri Contributor


Wanted to share that attribute rule properties do have describe documentation going back to their implementation.  You can find it below.

Attribute Rules Describe Properties

0 Kudos