Help for symbology

471
2
08-24-2021 05:12 AM
DavidRichard31
New Contributor III

Hi, 

The situation
We have a field crew who do thrash can clearance all over the city's park and they update  their work on a phone by only clicking yes or no in Collector / Field maps. Symbology changes from Done = green and Not done = red, classic story. 

The thing is : i would like to have a yellow one who means «done 3 days ago» based on the editdate field.

Is this something's possible? 

If you have any idea, feel free to drop your idea here! 

I'm kindda lost!



0 Kudos
2 Replies
jcarlson
MVP Esteemed Contributor

Check out the Arcade functions DateAdd and Now. If you set your symbology to an expression, you can do the following:

// Timestamp of 3 days prior to current moment
var days_ago = DateAdd(Now(), -3, days)

// Yes/No field
var done = $feature.status

// First check if feature is 'done'
if(done == 'yes'){
    // Now check if it was done recently
    if($feature.edited_date >= days_ago){
        return 'Recently Cleared'
    } else {
        return 'Cleared'
    }
} else {
    return 'Not Cleared'
}

 This should give you three distinct categories which you can symbolize your features by, setting the colors of each as you like.

NOTE: If you are setting this up an an AGOL / Portal web map, you'll only be able to set symbology for categories which are currently present in the layer. If there are no "Not Cleared" features, for example, you won't get to set the color / shape for those features.

If that is an issue for you, know that you can open the web map in ArcGIS Pro, define the additional symbology categories, then save the web map from there.

- Josh Carlson
Kendall County GIS
0 Kudos
DavidRichard31
New Contributor III

I'll give a try right away! 
Thank you for the quick response John!

0 Kudos