Since version: 1.5
With the Attribute Rule Validation profile, expressions can be written to evaluate whether or not a feature meets the criteria defined in the expression. This profile is used for validation attribute rules in ArcGIS Pro. The script should return a Boolean with true
indicating the feature meets the validation criteria or false
indicating it does not meet the criteria.
Context
The following products implement this profile:
- ArcGIS Pro
- ArcGIS Enterprise
- ArcGIS Maps SDKs for Native Apps
Spatial reference
The spatial reference of the expression's data source1 determines the execution context's spatial reference.
Time zone
The time zone of the expression's data source1 determines the execution context's default time zone.
Profile variables
Variable Name | Type | Description | Since version |
---|---|---|---|
$datastore | FeatureSetCollection | A collection of layers in the same feature service or database as the $feature executing the script. | 1.5 |
$feature | Feature | The feature being evaluated for the constraint. | 1.5 |
$featureSet | FeatureSet | A collection of features in the same table as the $feature evaluating the expression. | 1.13 |
Function bundles
Core | Geometry | Data Access
Return types
For a list of valid dictionary keywords, click here.
Example
The following example is a validation rule created on a poles feature class to ensure that when the structureheight is 65 feet or greater, the material must be made of steel. An error feature is generated if this is not true.
if ($feature.structureheight >= 65)
{
If (DomainName($feature, 'Material') == 'Steel')
{ return true; }
else
{ return false; }
}
else
{ return true; }
- Data source can be a file geodatabase, mobile geodatabase, or mobile service.