HOW TO

Display a countdown in the Indicator element using Arcade in ArcGIS Dashboards

Last Published: April 26, 2024

Summary

In ArcGIS Dashboards, dashboard elements can be configured to display information in an easy-to-read format. This article provides the workflow to display a countdown in the Indicator element using an Arcade expression.

Procedure

  1. In ArcGIS Dashboards, in Layout, on the Body tab, click Add element, and select Indicator.
Add an Indicator element to a dashboard by navigating to the Body tab, click 'Add element', and select Indicator in the drop-down list. The Indicator element option is symbolized with a 99! icon.
  1. Select a layer from the map added to the dashboard.
  2. On the Indicator page, select the Indicator tab.
  3. Under Indicator options, for Advanced formatting, click Enable.
To edit the Arcade expression for the Indicator element, navigate to the Indicator tab, and under Indicator options, click Enable on the right to enable 'Advanced formatting'.
  1. On the Expression tab, highlight and delete the existing expression in the box.
  2. Copy and paste the following Arcade expression into the box. For the Date function in endDate, replace the year, month, and day with the desired values.
var startDate = Today();
var endDate = Date(year,month,day);
var daysLeft = DateDiff(endDate, startDate,'day');

return {
middleText: daysLeft,
middleTextMaxSize: 'large',
bottomText: 'Days left!',
}
Note:
In the Date function, months are defined by 0-11 where 0 is January and 11 is December. For example, to indicate May, type '4' as the month in the Date function.
  1. The Indicator preview displays the countdown. In this example, the startDate is today, March 10, 2022, and the endDate is '2022,4,30' (May 30, 2022).
The Indicator element preview displays the text, '81 Days left!' based on the Arcade expression. The startDate is set to 'Today', and the endDate is set to '2022,4,30' which stands for May 30, 2022.
  1. Click Done. The Indicator element is configured to display a countdown in the dashboard.

Article ID: 000027014

Software:
  • ArcGIS Online
  • ArcGIS Dashboards

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