Skip To Content

Attribute rule dictionary keywords

Dictionary keywords expose advanced behavior of attribute rule functionality, such as returning custom error messages within conditional statements or performing edits to features in another feature class. When authoring arcade expressions for attribute rules, the return dictionary type must use one of the reserved keywords listed below. To perform multiple operations, extend the dictionary with different keywords. To learn more about how to use these dictionary keywords, see Attribute rule script expression examples.

result

Provides a valid return value. You can use the result keyword to return a value and another dictionary keyword.

return {
    'result': 200
}

errorMessage

Specifies a user-defined error message for a failure during evaluation. Use the errorMessage keyword when creating logical statements in arcade expressions to return custom error messages. This keyword cannot be returned in a dictionary with another keyword.

return {
    "errorMessage": "Error message text"
}

calculationRequired

Marks other features as requiring evaluation of batch calculation rules. When this keyword is used, the corresponding feature or features are marked as requiring calculation by modifying the Validation Status attribute. This keyword can only be used with calculation rules, and the Exclude from application evaluation option must be set to true.

Keyword parametersDescription

className

(required) Keyword to specify the name of the feature class or table to modify. Value is the feature class name.

objectIDs | globalIDs

(required) Keyword to specify an array of ObjectIDs or GlobalIDs to modify. Value is an array of ObjectIDs or GlobalIDs.

return {
    'calculationRequired': [{
        'classname': 'featureclass_name',
        'globalIDs': ['8B421724-32D0-408A-A8EE-CCC2B064D52B']
    }]
}

validationRequired

Marks other features as requiring evaluation of validation rules. When this keyword is used, the corresponding features are marked as requiring validation by modifying the Validation Status attribute. This keyword can only be used with calculation rules, and the Exclude from application evaluation option must be set to true.

Keyword parametersDescription

className

(required) Keyword to specify the name of the feature class or table to modify. Value is the feature class name.

objectIDs | globalIDs

(required) Keyword to specify an array of ObjectIDs or GlobalIDs to modify. Value is an array of ObjectIDs or GlobalIDs.

return {
    'validationRequired': [{
        'classname': 'featureclass_name',
        'globalIDs': ['60905A3D-9783-435D-B4C9-AA4ADA59AD32']
    }]
}

edit

Performs inserting, updating, and deleting features in specified feature classes. This keyword can only be used with calculation rules, and the Exclude from application evaluation option must be set to true.

For a utility network, the edit keyword can be used to create associations by using the associationType keyword inside the edit dictionary.

Keyword parametersDescription

className

(required) Keyword to specify the name of the feature class or table to modify. Value is the feature class name.

adds | updates | deletes

Keyword to specify the type of edit to make. Value is an array of dictionaries detailing the edits for each edit type.

Note:

Do not create a script that performs recursive edits. If a script is configured to perform an edit that triggers or evaluates the attribute rule, an infinite loop is created. This will cause unintended results.

return {
    'edit': [{
        'className': 'b_edit_dict',
        'adds': [{
            'attributes': {
                'field_name': 11
            },
            'geometry': Geometry({
                'x': -76.8375008,
                'y': 39.4949383,
                'spatialReference': {
                    'wkid': 4326
                }
            })
        }],
        'updates': [{
            'globalID': '{7EBAB596-E9DB-40D8-9756-B2EBED2500B7}',
            'attributes': {
                'field_name': 22
            }
        }],
        'deletes': [{
            'objectID': 22
        }]
    }]
}

adds

Keyword to use within the edit dictionary to perform inserts to a specified feature class or table.

Keyword parameterDescription

attributes

Keyword to edit specified fields. Value is a dictionary of field name and attribute pairs.

geometry

Keyword to edit the geometry. Value is a Geometry object.

associationType

Keyword specific to making association edits in a utility network. Possible values include:

  • connected
  • container
  • content
  • structure
  • attached

fromTerminal

Keyword to specify the from terminal to create a connectivity association. Value is terminal name.

toTerminal

Keyword to specify the to terminal to create a connectivity association. Value is terminal name.

isContentVisible

Keyword to specify whether the content is visible for a containment association. Value is true or false.

updates

Keyword to use within the edit dictionary to perform updates to a specified feature class or table.

Keyword parametersDescription

objectID | globalID

(required) Keyword to specify the ObjectID or GlobalID value of a feature to edit. Value is an ObjectID or GlobalID.

attributes

Keyword to edit specified fields. Value is a dictionary of field name and attribute pairs.

geometry

Keyword to edit the geometry. Values is a Geometry object.

associationType

Keyword specific to making association edits in a utility network. Possible values include:

  • connected
  • container
  • content
  • structure
  • attached

fromTerminal

Keyword to specify the from terminal to create a connectivity association. Value is terminal name.

toTerminal

Keyword to specify the to terminal to create a connectivity association. Value is terminal name.

isContentVisible

Keyword to specify whether the content is visible for a containment association. Value is true or false.

deletes

Keyword to use within the edit dictionary to perform deletes of specified features in a feature class or table.

Keyword parametersDescription

objectID | globalID

(required) Keyword to specify the ObjectID or GlobalID value of a feature to edit. Value is an ObjectID or GlobalID.