AGOL symbolgy by date

371
1
04-16-2019 08:52 AM
JDSF_PeterRowland
New Contributor III

If points have a start date and end date in the attribute table, is it possible to symbolize them as active or inactive in AGOL based on the current date?

0 Kudos
1 Reply
MarkBockenhauer
Esri Regular Contributor

Yes, you can using Arcade.

In this map I am labeling by  Start Date.

Add an Arcade Expression

A few ways of doing this, I took an "IF Else" approach.

var starttime = $feature.startdate;
var endtime = $feature.enddate
var currenttime = Now()
var status = ""
if (starttime > currenttime){
      status = "Befor Start Date"
}
else if(currenttime < endtime){
      status = "Active"
}
Else{
      status = "Past End Date"
}
return status

Click OK and Done

Symbolized by status variable.