AnsweredAssumed Answered

How to make features to be automatically shown/hidden based on start and end date time fields?

Question asked by MHArcGISOnline on Nov 24, 2017
Latest reply on Nov 24, 2017 by rscheitlin

Hello:

I have an ArcGIS Online web map to show road closures. Each road closure has a start date time and end date time. I have an Arcade script below:

var start = $feature.STARTDATE;
var end = $feature.ENDDATE;
var td = Today ( );
if (start <= td && end >= td){
    return 'Active';
}
else if (start < td && end < td){
    return 'Past';
}
else {
    return 'Future';
}

The Custom is added in the popup:

popupwCustom

Can I use Custom value, such as Custom='Active', to make features to be automatically shown/hidden?

 

Thank you.

Outcomes