Attribute rules are defined by the data author to enhance the editing experience and improve data integrity for geodatabase A geodatabase is a spatial data storage format that can contain multiple datasets of geographic features and non-spatial tabular data, as well as attachments, field domain definitions, and relationships between layers/tables. Learn more datasets. They can automatically populate attributes Attributes are fields and values for a single feature or non-spatial record. They are typically stored in a database or service such as a feature service. Learn more , restrict invalid edits during edit operations, and perform data validation checks on existing features. Attribute rules are defined using ArcGIS Pro ArcGIS Pro is a professional desktop GIS application that can explore, visualize, analyze, and manage 2D and 3D data. Learn more and are written with the Arcade Arcade is a lightweight and secure expression language used in ArcGIS products and APIs. Arcade expressions are commonly used to calculate or format field values for data-driven visualizations, labels, and popups. The expressions work against data stored in data services. Learn more expression language. See the ArcGIS Pro documentation for an Introduction to attribute rules and Attribute rule script expression examples.

When editing a dataset with attribute rules, no additional code is required to leverage rule evaluation in your app. Any add, update, or delete feature operation may trigger rule evaluation depending on how the data author configured the rule.

Support for attribute rules

Attribute rules are supported in the following feature tables A feature table is a database table of a single geometry type, such as point, line, or polygon, that stores features that conform to the schema of the table. Learn more and geodatabases A geodatabase is a spatial data storage format that can contain multiple datasets of geographic features and non-spatial tabular data, as well as attachments, field domain definitions, and relationships between layers/tables. Learn more :

Attribute rules are not supported in a ServiceFeatureTable created using any of its constructors. These stand-alone service feature tables lack the context of their parent geodatabase, which is required to evaluate attribute rules.

Attribute rule evaluation on the client

Using ArcGIS Pro ArcGIS Pro is a professional desktop GIS application that can explore, visualize, analyze, and manage 2D and 3D data. Learn more , the data author can define whether the attribute rules are evaluated immediately, or at a specified time (deferred). Deferred attribute rules are useful if you want to perform data validation for existing features on the feature service. Rules set for immediate evaluation are evaluated during editing, after a feature is added to, updated in, or deleted from the local geodatabase. The data author can control whether attribute rules are evaluated in your app, following the ArcGIS Pro instructions in Evaluate attribute rules. For your app to evaluate attribution rules, the data author must set the Exclude from application evaluation to off.

If the rule’s Exclude from application evaluation is turned off, each time you edit a feature from one of the supported feature tables, the attribution rule is evaluated locally in your app.

If the rule’s Exclude from application evaluation is enabled, the attribution rule is not be evaluated in your app but on the feature service, or data source, when ServiceGeodatabase::applyEdits() is called or when the SyncGeodatabaseJob completes. Edits made by the feature service due to rule execution are automatically reflected in your app if you use a ServiceGeodatabase or in the replica version of the sync-enabled Geodatabase. However, updates in the replica version are available for download to your app after they have been reconciled and posted to the default branch version. For more information, see the Synchronize with a replica version documentation.

If your app is editing features from a stand-alone Geodatabase exported from ArcGIS Pro, all attribute rules are evaluated no matter the Exclude from application evaluation value. In this instance, the stand-alone Geodatabase, unlike a sync-enabled mobile geodatabase that is a client to a backend feature service, is operating as the data source.