Hi all,
I am trying to produce a webmap in ArcGIS online from a hosted feature layer to show current event locations.
The point feature layer has 2 time-based fields - StartDate and EndDate representing each event.
I would like to produce a dynamic map of 'todays events' which will only show those events which are currently on.
So far I have tried creating a filter expression using the 'in the last' option, but this wont work as my data wont suit this approach.
I also tried using an Arcade expression as follows based on code i found here:
--------------------------------------------------------------------------------------------------------
var started = $feature.Start_Date
var closed = $feature.End_Date
var present = Now()
// if current date/time is greater than or equal to the start time
// AND current date/time is less than or equal to the close time
// return open, otherwise its closed
If (present >= started && present <= closed) {
return "Open today"
}
----------------------------------------------------------------------------------------------------------
However when I go to view this in my webmap I find that everything not returned as "Open today" is classified "Other" and is still selectable on my webmap popup, even if its visibility is removed.
Is there a way using Arcade expressions in ArcGIS online to remove or filter out these unwanted geometries?
Any help much appreciated,
Thanks
Andrew