On survey 123, is there a way to include a question type to only show the submission in the map for a specified period of time? For example, if I am making a form to allow different campus departments to show the locations and dates of the outreach events they are doing on a map, I will like the submissions associated with past events to be automatically taken off the map or at least automatically hidden. Thank you.
Hello Wing Cheung,
When you are referencing in the map when you say "only show the submission in the map for a specified period of time", are you talking about a Web Map in ArcGIS Online/Enterprise or are you referring to the map on the Data tab of the ArcGIS Survey123 Website?
If you are referencing a Web Map in ArcGIS Online/Enterprise, by default Survey123 surveys should have editor tracking automatically enabled so you can apply a filter on the data to only show records after a certain submission date for example.
If you are referencing the map on the Data tab of the ArcGIS Survey123 Website on the top left you can filter by submission date or another attribute in the survey.
Thank you,
Zach
Thank you for the quick reply Zach. Your response makes sense. I am thinking of the Web Map in ArcGIS Online. I was hoping that there is a way to automate the filtering, since the web map will be public-facing, and the user may not know how to filter the features in the map.
Hello Wing Cheung,
Thank you for confirming! For the Web Map in ArcGIS Online when you set a filter on a service in the Web Map and save it all viewers of the Web Map will see the filtered content.
Another option would be to set a filter on the Hosted Feature Service itself on the visualization tab of the Item Details page. That way when the web map hits the service the data will already be filtered.
I am not sure of a way to automate filtering maybe an Arcade expression would be able to dynamically change the filter but I'm not sure what that would look like.
Adding Peter Klingman as he would know more. Peter have you seen a way to automate the filtering of records on a Hosted Feature Service or Web Map in ArcGIS Online?
Thank you,
Zach
Thanks Zach, reading through the thread it looks like a relative date filter will provide what is needed here. You cannot set a dynamic filter with an Arcade expression per se, but filters are automatically applied to any new features in the layer.
In my example below, if this relative date filter is set in the web map or visualization tab, it will immediately show any new features that are added and will not show features older than a day.
Hope this helps,
-Peter
Thank you Peter and Zach. I think those ideas will work and I will try them. So if I am understanding correctly, I can probably include a question in the Survey that asks the completer of the survey for "the date of the event", and then set a relative date filter in the web map so that only the events that are occurring beyond today's date will be displayed? The only problem I am running into is that the relative date filter seems to only work with the "in the last" operator. Is there a way to use the "is after" operator, and then somehow have ArcGIS online automatically update today's date as the parameter?
Hi Wing Cheung this is not currently possible but is under consideration per this idea: In AGOL allow queries/filters by current date. It would be worthwhile to upvote the idea and post your use case.
As a workaround, you may be able to use something like:
Hope this helps,
-Peter