Dynamic symbology based on days passed

335
4
Jump to solution
11-05-2019 09:40 AM
Highlighted
New Contributor II

I am trying to have symbology for a pesticide treatment automatically change after 6 days from the application. how would I go about doing this? I would like it to be visible to field workers in collector as well as AGOL.

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Regular Contributor

Tim,

You could try symbolizing the map using Arcade expression. (note: arcade expressions are not supported in Classic Collector).

Something like this.

In this example the creation date is used, but you could use last edited date, if you process is to just keep the attribute up to date for areas that have had treatments applied.

var time1 = Date($feature["created_date"])
if(DateDiff(Now(), time1, 'hours')<=1){
Var Status = "New";
}
else if(DateDiff(Today(), time1, 'days')>=0){
var Status = "Old";
}
else{
var Status = "Current";
}
return Status

Mark

View solution in original post

4 Replies
Highlighted
Frequent Contributor II

No since dynamic symbol would be too slow.  What about having the layers in the map twice with a filter?

Reply
0 Kudos
Highlighted
Esri Regular Contributor

Tim,

You could try symbolizing the map using Arcade expression. (note: arcade expressions are not supported in Classic Collector).

Something like this.

In this example the creation date is used, but you could use last edited date, if you process is to just keep the attribute up to date for areas that have had treatments applied.

var time1 = Date($feature["created_date"])
if(DateDiff(Now(), time1, 'hours')<=1){
Var Status = "New";
}
else if(DateDiff(Today(), time1, 'days')>=0){
var Status = "Old";
}
else{
var Status = "Current";
}
return Status

Mark

View solution in original post

Highlighted
Frequent Contributor II

I thought about using Arcade but for me I was using FeatureSet commands and they cannot be used.  But what Mark laid out it seems to allow.

Reply
0 Kudos
Highlighted
New Contributor II

Thanks for the response. It helped a ton!

Reply
0 Kudos