Hello,
I've created a snowplow app in experience builder. It shows roads that have been plowed within specific time frames (less than 4 hrs, 4-8hrs etc) which I've set up using arcade expressions in the web map. I have a filter widget in my application that is meant to allow users to turn the roads on and off based on the last time they were plowed. I have 4 filters in my map and all are configured the same way (SQL query: Time is not in the last 1 day). The less than 4 hours filter only turns off some of the roads in that category. Does anyone know why this may be happening?
I'm happy to look into why this might be happening - however I might need to check a couple details for your set up first.
Could you confirm, is the issue that you are toggling on the "Under 4 Hours" filter and you would expect this to turn off all roads that were ploughed in the last 4 hours and this is not occurring? The roads that you have showed that are still appearing, were they ploughed in the last 4 hours and is it different roads that this happens to every time?
Thanks,
Issy
Have you configured your data to Auto Refresh? Could your problem be the result of stale data? Unless the data is configured to refresh, it will stay in the state of the data when the application loads.
@IssyAmis yes, I would expect the green lines to disappear from the map when the "Under 4 Hours" toggle is clicked. I'm wondering if the Time_Stamp field is the issue. As I was looking at the app the other day, the green lines that stayed on showed a timestamp that hadn't occurred yet (eg. 11am UTC when it was 11:15 EST).
Thanks for the suggestion, @JeffreyThompson2. This option appears to affect more than just the layer that is configured with this setting (I've moved my sidewalk plow lines to the pending list and when I set a custom refresh interval on the roads layer, the sidewalks layer appears on the map too).
Hi @SarahRijneke Sorry I'm just getting round to looking into this.
Is this still occurring? I would say it definitely sounds like an issue with the time stamp field - especially if you can see that the time is in the wrong format. Would you like any help correcting this?
I got around it by changing the filter query (Time_Stamp is not in the last 1 Day and Time_Stamp is in the last 1 Day).
I'm not convinced that the data is appearing properly in my app though. For example, Queen Street appears green (Under 4 hours) but it's timestamp is 10PM and it is now 2:15pm EST.
This is the arcade expression I use to configure the symbology:
if (DateDiff ( now() , Date($feature.Time_Stamp) , 'hours' ) <= 4){
return "Under 4 Hours"}
else if (DateDiff ( now() , Date($feature.Time_Stamp) , 'hours' ) > 4 && DateDiff ( now() , $feature.Time_Stamp , 'hours' ) <= 8 ){
return "4-8 Hours"}
else if (DateDiff ( now() , Date($feature.Time_Stamp) , 'hours' ) > 8 && DateDiff ( now() , Date($feature.Time_Stamp) , 'hours' ) <= 16 ){
return "8-16 Hours"}
else if (DateDiff ( now() , Date($feature.Time_Stamp) , 'hours' ) > 16 && DateDiff ( now() , Date($feature.Time_Stamp) , 'hours' ) <= 24 ){
return "16-24 Hours"}
else if ($feature.Time_Stamp == null){
return "No Data"}