HOW TO

Label the status of a deadline based on the date field of a feature layer using ArcGIS Arcade in ArcGIS Online

Last Published: August 18, 2023

Summary

In ArcGIS Online, a feature layer can be configured to display the status of a deadline based on the date field. This is important to ensure complex projects are kept on track and completed by a specific time frame.

This article describes the workflow to label the status of a deadline based on the date field of a feature layer using ArcGIS Arcade in ArcGIS Online.

Procedure

Note: 
This workflow requires the feature layer to have a date field. Refer to ArcGIS Online: Date fields in ArcGIS Online for more information.
  1. In ArcGIS Online Map Viewer, open the web map containing the features.
  2. On the Contents (dark) toolbar, click Layers to open the Layers pane and select the layer intended to be configured.
  3. On the Settings (light) toolbar, click Labels.
  4. In the Label features pane, turn on the Enable labels toggle button.
  5. Click Add label class and under Label field, click the Use expression The Use expression button button.
  6. In the editor window, create a name for the Arcade expression and specify the Arcade expression. In this example, if the deadline is before today's date, the label updates to 'overdue'. If the deadline is within 30 days before today's date, the label updates to 'nearly due'. If the deadline is more than 30 days before today's date, the label updates to 'on schedule'. Replace '<fieldName>' with the name of the field and '<dateValue>' for the total number of days.
IIF (DateDiff($feature.<fieldName>, Today(), 'days') > <dateValue>, "on schedule", IIF(DateDiff($feature.,<fieldName>, Today(), 'days') >= 0, "nearly due", "overdue"))
  1. Click Done.

The image below shows the full working script in the editor window. 

The expression editor window

The image below shows the status of deadlines are labeled based on the date field of a feature layer in ArcGIS Online.

The status of deadlines are updated in the feature layer

Article ID: 000029168

Software:
  • ArcGIS Online

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