I'd like to setup a filter in an AGOL web map to only display features with a date attribute in the current calendar year. I.e., show all features in the current calendar year '2025', but when the year changes the map will automatically update to only show features with dates in '2026' and so on.
One option is to set the filter to be after January 1 of the current year, but this requires a manual intervention to update the date at the start of each year:
There is also 'in the last' filter, but this includes all dates in the past year, not by the calendar year.
I found this resource but this doesn't work with symbology with unique values, and it only hides features (the pop-ups still appear).
Feeling stuck here. Is there any way to set up a filter like this directly in a web map?
Hi @mwartman_grey,
One way you can set the filter to start by calendar year is to do the following:
@RPGIS, not sure where to see those options in the map viewer filter builder. These are the date condition options I see:
Sorry @mwartman_grey ,
I realized that I was thinking of the filter that is used in the Dashboards. In terms of filtering by the current year, the best way is to usually create another field as text ( ex. "Current" ) if the year is equal to this year and filter by that value. There are python scripts that you can run to populate the field. You can go a step further by automating the script using .bat file and run using windows task scheduler.
I don't think this option exists directly in the Map Viewer. I have added it to the ArcGIS Online Ideas board: https://community.esri.com/t5/arcgis-online-ideas/map-viewer-dynamic-date-filter-based-on-current/id...
Also related: https://community.esri.com/t5/arcgis-online-ideas/map-viewer-date-filter-today-after-today-date/idi-...