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
- In ArcGIS Dashboards, in Layout, on the Body tab, click Add element, and select Indicator.
- Select a layer from the map added to the dashboard.
- On the Indicator page, select the Indicator tab.
- Under Indicator options, for Advanced formatting, click Enable.
- On the Expression tab, highlight and delete the existing expression in the box.
- 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.
- 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).
- Click Done. The Indicator element is configured to display a countdown in the dashboard.