Calculation attribute rules—ArcGIS Pro | Documentation (2024)

Calculation rules are used to automatically populate attribute configurations on a feature. They can be created as immediate calculation rules or batch calculation rules, depending on when the rule needs to be evaluated as follows:

  • Immediate calculation rules—Rule evaluation occurs immediately during edit operations. The type of triggering event specified during rule creation allows rule evaluation to occur based on insert, update, or delete operations.
  • Batch calculation rules—Rule evaluation occurs at a user-specified time.

Attribute fields associated with a calculation rule can be configured to allow user edits or to be read-only. When creating calculation rules, the Is Editable check box is available under the input field to which it applies, as follows:

  • Checked—User-defined attribute edits are permitted on a field. User input for this field can be overwritten by evaluation of an attribute rule based on the rule definition.
  • Unchecked—User-defined attribute edits are not permitted, and the attribute field the rule is created on is defined as a system-maintained field. The calculation rule will be applied during the triggering event defined in the rule.
    Caution:

    Once a user-defined field is set as system maintained, it cannot be changed.

The following video demonstrates how to create an immediate calculation rule.

  • This video was created with ArcGIS Pro 3.2.

Immediate calculation rules

Calculation rules that are evaluated during edit operations based on certain triggering events are referred to as immediate calculation rules. This type of calculation rule is used in workflows in which calculations need to be performed automatically as edits are made.

Immediate calculation rules are created in the Attribute Rules view by clicking the Calculation Rule drop-down button Calculation attribute rules—ArcGIS Pro | Documentation (2) and clicking Immediate Calculation Calculation attribute rules—ArcGIS Pro | Documentation (3). This rule type can also be created using the Add Attribute Rule tool with the batch option set to false or the Import Attribute Rules tool.

Immediate calculation rules are evaluated at the time of the edit operation, based on specific triggering events. The triggering events (insert, update, or delete) are specified as a property of the rule.

Dive-in:

Direct data changes from a record being deletedmight not be observed with an immediate calculation rule. But depending on the Arcade script, other advanced attribute rule functionality might be observed,such as editing another feature with the delete trigger. See Attribute rule dictionary keywords for more information.

Batch calculation rules

Calculation rules that are evaluated at a user-specified time are referred to as batch calculation rules. This type of calculation rule is designed for situations when you want to perform calculations on existing features or you need control over when the rule evaluation occurs. This could be for instances when the calculation is too expensive to be performed at the time of the edit operation.

Note:

Batch calculation and validation attribute rules are only supported on point, line, and polygon feature classes or tables. For enterprise geodatabases, these rule types are only supported for branch versioned datasets.

Batch calculation rules are created in the Attribute Rules view by clicking the Calculation Rule drop-down button Calculation attribute rules—ArcGIS Pro | Documentation (4) and clicking Batch Calculation Calculation attribute rules—ArcGIS Pro | Documentation (5). This rule type can also be created using the Add Attribute Rule tool with the batch option set to true or the Import Attribute Rules tool.

To evaluate batch calculation rules for a dataset, you can use the Evaluate Rules tool or the Error Inspector.

Note:

The input workspace for evaluating batch calculation and validation rules depends on the type of geodatabase the dataset with attribute rules is stored in:

  • File or mobile geodatabases—A geodatabase is the input workspace to evaluate.
  • Enterprise geodatabases—A feature service with the Validation capability is the input workspace to evaluate. If the same dataset is published to multiple services, be aware that the error layers and validation status attribute are shared for the default version.

The following are general steps involved in configuring and evaluating batch calculation rules for datasets in an enterprise geodatabase:

  • Register the dataset as branch versioned.
  • Configure the database connection to branch for the versioning type.
  • Add the attribute rule to the dataset.
  • Share the dataset as a web feature layer with the Validation capability enabled.
  • Make edits to the web feature layer.
  • Evaluate the rules and check features using the Error Inspector.
  • Review the error features and make edits to correct the errors.
  • Evaluate the rules once more.

To learn more, see Share datasets with attribute rules, Evaluate attribute rules, and Manage attribute rule errors.

Evaluation order

When rules are evaluated, the order controls the sequence in which rules are evaluated. For calculation rules, the order in which rules are evaluated on a dataset is important, as this can cause the result of the rule evaluation to differ.

The evaluation order is important when there are dependencies from other fields being calculated for the feature being stored. The following image illustrates how the result of the two calculation rules can vary depending on the evaluation order of the rules:

Calculation attribute rules—ArcGIS Pro | Documentation (6)

The evaluation order is a property of an attribute rule that can be viewed using the Attribute Rules view, or the arcpy.Describe function can be used to print the attribute rule properties. The evaluation order is initially determined by the order in which rules are created for a dataset and is stored as an integer value that starts with a value of 1. The order increases by one as new rules are created. Immediate and batch calculation rules independently maintain their own evaluation order.

The Attribute Rules view lists calculation rules based on the evaluation order in the Immediate and Batch sections. To make changes to the evaluation order, edit the Order column in the Attribute Rules view or use the Reorder Attribute Rule tool.

When a dataset contains multiple attribute rules, the execution also follows a specific order depending on the rule type. See Evaluate attribute rules for more information.

Examples

The following are examples of how calculation attribute rules can be used in a geodatabase:

  • Concatenate an array of text field values into a specified field.
  • When a pipe's LifeCycleStatus attribute is updated to Abandoned, the PressureZone attribute is updated to None.
  • When a power pole has a length greater than 65 feet, the material value will be calculated as steel.
  • When a new pole is created, generate a text value based on the sequence assetid_seq.
Tip:

When creating calculation rules, ensure the script expression results are using the same data type as the field being calculated.

See 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 you can use to construct script expressions for attribute rules.

See specific examples for attribute rule script expressions

Feedback on this topic?

Calculation attribute rules—ArcGIS Pro | Documentation (2024)

FAQs

What is the immediate calculation rule in ArcGIS Pro? ›

Immediate calculation rules

This type of calculation rule is used in workflows in which calculations need to be performed automatically as edits are made. . This rule type can also be created using the Add Attribute Rule tool with the batch option set to false or the Import Attribute Rules tool.

What are the constraint rules in ArcGIS Pro? ›

Constraint rules are evaluated immediately during edit operations for specific triggering events (insert, update, and delete) that are specified in the rule properties. If a constraint rule is violated, a user-defined error number and message are returned, and the feature edit is rolled back.

Do attribute rules work in ArcGIS online? ›

Attribute rules are not transferred when you publish datasets to an ArcGIS Online portal.

How do I sum attributes in ArcGIS Pro? ›

Procedure
  1. Launch the ArcGIS Pro project.
  2. Summarize the preferred field. In the Contents pane, right-click the feature class, and click Attribute Table. In this case, Pathways is selected. In the attribute table, right-click the field header, and click Summarize. In this example, the StreetName field is selected.
Aug 24, 2023

How do I change attribute value in ArcGIS Pro? ›

Click the Attributes tab. If the selected attribute is stored in an attributed relationship table, click the Attributed Relationship tab. Click a field and edits its value. Set the value to Null if the field accepts null values.

What is constraint vs rule? ›

Constraints need to be consistent. You can't assign a value to a constraint variable and change it to different values later, but it's the rule that allows you to do this.

What is a constraint attribute? ›

Attributes can have constraints associated with them, which typically indicate such things as maximum value, minimum value and length of field. You define these constraints on the Properties window for attributes.

What are the rules for field names in ArcGIS Pro? ›

You typically use field names that are as short as possible to convey what data is stored in that field. You cannot use spaces or special characters in the field name, and certain fields appear in the table with their fully qualified names.

Do attribute rules work in field maps? ›

Question: How does Field Maps work with attribute rules? Answer: Attribute rules are defined in ArcGIS Pro and can automatically populate attributes, restrict invalid edits during edit operations, and perform quality assurance checks on existing features.

What is the introduction of attribute rules? ›

Attribute rules are complementary to existing rules used in the geodatabase, such as domains and subtypes. For example, domains can be assigned to an attribute field to aid in the data collection process by providing a list of valid values for editors.

How to run a validation rule in ArcGIS Pro? ›

Run validation rules
  1. Add the floor plan layers from the branch versioned feature layer to a map in ArcGIS Pro.
  2. Configure the map as floor aware.
  3. Configure the Units and Details layers as floor aware.

How do I add attributes in ArcGIS Pro? ›

When you extract locations to a new map layer, new custom attributes are included in the output feature class's attribute table.
  1. Open the Extract Locations pane.
  2. Turn on the custom attributes toggle.
  3. Access the Custom Attributes tab.
  4. Add the custom attribute file (. ...
  5. Activate the custom attribute file.

How do I set topology rules in ArcGIS? ›

In the Catalog pane, right-click the feature dataset to which you want to add a topology and click New > Create Topology. Name the new topology and specify the cluster tolerance. The default value is set to the x,y tolerance of the feature dataset.

How do I set control points in ArcGIS Pro? ›

Add control points manually
  1. On the Georeferencing tab, in the Adjust group, click Add Control Points. ...
  2. Snap to and click the source Revit or CAD feature to create the from point. ...
  3. When the from point has been defined, the pointer prompt reads To point (target). ...
  4. Repeat steps 2 and 3 to create the second link.

Top Articles
Latest Posts
Article information

Author: Merrill Bechtelar CPA

Last Updated:

Views: 5669

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.