When you create an attribute rule, a script expression is used as the foundation of the rule. The script expression is constructed using the Arcade scripting language to control the rule behavior. Arcade can perform mathematical calculations, manipulate text, and evaluate logical statements. Arcade in attribute rules can be written to update field values, restrict certain edits, return messages to the user, and much more.
Reference the Arcade profile for the requirements and global variables to author attribute rule types. The Arcade Getting Started guide and Function Index are additional resources to begin constructing script expressions for attribute rules.
For specific examples of each rule type, see Attribute rule script expression examples.
Compatibility of Arcade in script expressions
Some Arcade functions are released with a specific Arcade version. This impacts what ArcGIS client release can access the dataset once an attribute rule using the function has been added. Reference the ArcGIS Arcade Version matrix and Release notes for more information.
You can review the compatibility of datasets with attribute rules and ArcGIS client release by configuring the Attribute Rules view to enable the Release columns.
View script expressions
The script expression of a dataset can be configured and viewed from the Attribute Rules view.
When a script expression references a dataset name with an Arcade function, such as FeatureSetByName, the dataset name is stored as a GUID in the attribute rule. This impacts viewing the attribute rule script expression of a layer from a service after sharing datasets with attribute rules. The referenced dataset name displayed varies depending on if it is included in the same service:
If the referenced dataset is not in the same service, the GUID is displayed.
If the referenced dataset is in the same service, the layer ID and name are displayed.
To view the reference dataset name as it is in the workspace, open the Attribute Rules view from a database connection.