HOW TO

Auto-populate the current date based on another field using an attribute rule in ArcGIS Pro

Last Published: December 14, 2023

Summary

In ArcGIS Pro, it is possible to copy field values from one feature to another. When working on a project involving continuous data collection, it is sometimes necessary to populate field values with the current date based on another field to ensure temporal information is synchronized with relevant attributes, providing dynamic and real-time perspective on spatial data.

In this article, an attribute rule is applied to auto-populate the Date field with the current date when the Employed field contains the ‘Yes’ field value in ArcGIS Pro.

Procedure

  1. Open the ArcGIS Pro project.
  2. In the Catalog pane, browse to and right-click the feature class, and click Manage.
  3. In the Feature Class Properties window, in the Manage section, check the Global IDs check box, and click OK.
Enabling Global IDs for the feature layer.png
Note:
The dataset requires Global IDs to add an attribute rule.
  1. Right-click the feature layer in the Contents pane and click Data Design > Attribute Rules.
  2. Click the Add Rule drop-down list and select Add Immediate Calculation Rule.
  3. Specify a Rule Name. In this example, New Rule is used.
  4. For Field, select the field to be auto-populated. In this example, Date is used.
  5. Insert and configure the expression below in the Expression box.
if ($feature.<field_name> == '<field_value>') {
return Now();
} else {
return Null;
}
  1. Replace <field_name> with the name of the of the field containing the field values. In this example, the field is Employed.
  2. Replace <field_value> with the desired attribute value. In this example, 'Yes' is used.
  1. Under Triggers, check the Update check box. In this example, Insert and Update are checked.
Attribute rule configuration.png
  1. On the Attribute Rules tab, in the Attribute Rules group, click Save.

The image below displays the current date of employment, which is populated in the Date field when the Employed field contains the 'Yes' value.

Populating field based on other field values.gif

Article ID:000031538

Software:
  • ArcGIS Pro 3 0
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 2

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options