Select to view content in your preferred language

How to list existing Attribute Rules?

158
1
Jump to solution
3 weeks ago
Brian_Wilson
Regular Contributor II

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
Regular Contributor II

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

1 Reply
Brian_Wilson
Regular Contributor II

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.