HOW TO

Populate a date field with a current date using Arcade in ArcGIS Pro

Last Published: May 26, 2024

Summary

In ArcGIS Pro, it is possible to populate a date field with a current date in an attribute table using an Arcade expression. This method is useful for accurate spatial data management and analysis, such as asset maintenance records, weather observations, or live tracking.

In this example, the feature layer containing the date field named ‘TestData’ is populated with the current date using the Now() function in ArcGIS Arcade. The image below displays the attribute table with a date field before being populated with the current date.

Attribute table displaying different dates in the date field.png

Procedure

  1. Open the ArcGIS Pro project.
  2. In the Contents pane, right-click the feature layer and click Attribute Table.
  3. In the attribute table, right-click the field name, and select Calculate Field. In this example, the TestData field is selected.
  4. In the Calculate Field window, specify the following parameters:
    1. For Input Table, ensure the layer selected in Step 2 is prefilled. In this example, the input table is Test.
    2. For Field Name, ensure the field selected in Step 3 is prefilled. In this example, the field name is TestData.
    3. For Expression Type, select Arcade.
    4. For Expression, in the expression box, specify the expression provided below.
Now()
    1. Click the Verify icon to validate the expression.
    2. Click OK to run the script.
    Calculate field window with Arcade configuration.png

    The image below shows the attribute table with the date field populated with the current date.

    Attribute displaying the current date in the date field.png

    Article ID:000031483

    Software:
    • ArcGIS Pro 3 1
    • ArcGIS Pro 3 0
    • 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

    Get help from ArcGIS experts

    Contact technical support

    Download the Esri Support App

    Go to download options