Since version: 1.6
With the Form Constraint profile, expressions can be written to evaluate whether or not a feature meets the criteria defined in the expression. This profile is used for advanced attribute editing in Forms. The script should return a Boolean with true
indicating the feature meets the constraint criteria or false
indicating it does not meet the criteria.
Context
The following products implement this profile:
- ArcGIS Maps SDK for JavaScript
- ArcGIS Online
- ArcGIS Enterprise
- ArcGIS Field Maps
Spatial reference
The spatial reference of the map in which the expression executes determines the execution context's spatial reference.
Time zone
The time zone of the map in which the expression executes determines the execution context's default time zone.
Profile variables
Variable Name | Type | Description | Since version |
---|---|---|---|
$feature | Feature | The feature being evaluated for the constraint. | 1.6 |
$originalFeature | Feature | The previous state of the feature. | 1.22 |
$editcontext.editType | Text | Indicates whether the edit event is INSERT , UPDATE , DELETE , or NA (not applicable). | 1.22 |
$layer | FeatureSet | A collection of features in the same layer as $feature . | 1.22 |
$datastore | FeatureSetCollection | A collection of layers in the same feature service or database as $feature . | 1.22 |
$featureSet | FeatureSet | A collection of features in the same table as $feature . | 1.22 |
$map | FeatureSetCollection | A collection of feature service layers in the same map as $feature . | 1.22 |
Function bundles
Core | Geometry | Data Access | Portal Access
Return types
Example
Returns a Boolean value indicating if the feature has a "Completed" status and if the value of resolution is not null.
$feature.status == 'Completed' && !IsEmpty($feature.resolution)