Select to view content in your preferred language

Dynamic, overrideable date range in web map

04-15-2019 12:02 PM
Status: Open
Occasional Contributor II

I would like to use dynamic dates in my web map so my web app always has the correct data. For example, I would like for my web map to display data  which is dated within the last two weeks. When I view the map this week, the data would include the two weeks prior to today. When I open the map in a couple of weeks, the data would include the two weeks prior to the day I am viewing the map.

When I add this web map to a web app, the filters the user applies in the app can override the two week range. The user can filter the dates however they need after the map loads. That way, their initial view of the data is for the two week period prior to the date they opened the app. They can then open the filter widget and set a date or date range to view any other data.

Currently, I can set the web map to initially display data after a particular date. Maybe I pick a date two weeks before today. As time goes on, the date range has the hard coded date and the amount of data increases. For example, if I set the web map to display data after 04/01/2019, the web app displays all data from then until now. Maybe 1700 points. After a few weeks, the number of points grows to maybe 2500 points because the initial date is hard coded.

What I want to have happen. I would like to set the web map to display data within two weeks (or another range) of the current date. When the user opens the web app, the data points are only those which have dates two weeks (or whatever range) from the current date. This could be accomplished by setting the web map to display data from the last 2 weeks, or 2 months, or 2 years. Or, 6 weeks, 3 months, 5 days, etc.

I do not want to apply a definition query to my data before I publish it because I want the user to have access to the whole set of data which in this case is over 800,000 points. I want to limit the amount of data that is initially displayed but not limit the ability of the user to view data from another time period.

I hope this makes sense!