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:

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 NameTypeDescriptionSince version
$featureFeatureThe feature being evaluated for the constraint.1.6
$originalFeatureFeatureThe previous state of the feature.1.22
$editcontext.editTypeTextIndicates whether the edit event is INSERT, UPDATE, DELETE, or NA (not applicable).1.22
$editcontext.editTagTextA text value originating from an attribute rule's edit dictionary. An attribute rule expression author can set editTag in a return dictionary for downstream edits triggered by attribute rules. When an edit triggers another attribute rule, the value for editTag set by the rule that triggered the edit is populated here with the value. Use this with $editcontext.editType to distinguish user edits from edits made by attribute rules. The default value is "" in all Attribute rules profiles which indicates a user edit. This value may be null on other profiles.1.38
$layerFeatureSetA collection of features in the same layer as $feature.1.22
$datastoreFeatureSetCollectionA collection of layers in the same feature service or database as $feature.1.22
$featureSetFeatureSetA collection of features in the same table as $feature.1.22
$mapFeatureSetCollectionA collection of feature service layers in the same map as $feature.1.22

Function bundles

Core | Geometry | Data Access | Portal Access

Return types

Boolean

Example

Returns a Boolean value indicating if the feature has a "Completed" status and if the value of resolution is not null.

Use dark colors for code blocksCopy
1
$feature.status == 'Completed' && !IsEmpty($feature.resolution)

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.