I want to document a workaround for a very pesky bug I ran into today.
Bug description: Sync of an offline area fails when an editable layer includes any "in the last" time-based filter.
Platform: Android, Field Maps 25.1.0
Most similar known bug:
To recreate:
1. Publish a layer from ArcGIS Pro that has a Date field called "date".
2. Create an offline-ready web map containing the layer as editable, and apply any "in the last" filter. E.g. "in the last 12 hours". Interestingly, you can apply this filter to any date field, not just the field named "date", and trigger the same bug. For example, a CreationDate field.
3. Download an offline area, make some edits, and attempt to sync.
4. Sync fails, and edits are left in the "local changes" queue.. but they are still applied to the feature service.
Workaround:
1. Republish the layer, and name the date field anything but "date". Ex. "date_observed".
Offline areas will now sync with "in the last" filters applied, to any field.
2. "In the last filter" no longer causes sync to fail, edits applied as expected.
Thoughts:
ArcGIS Online will not allow you to create a field called "date". Attempting to publish a layer with a field called date from ArcGIS Pro should probably trigger a warning.
Hi @willbruce_KarukTribeDNR , are you saying that the BUG you mention and link to has potentially resurfaced? I gave it a shot on some data using a relative date filter (i.e. "in the last") on a date field and sync is working for me.
Thanks for your reply. Not sure if that particular bug is the same as the one I described - it was just was the closest I could find when searching. The bug I ran into only occurs when using a relative date filter on a date type field named "date". And I only tested it on Android.
Thats interesting. I set up this filter on a field "Date" and tried it on iOS and Android. I am wondering if there is potentially another variable. Are you adding/editing data that then falls outside or inside of this filter? It is good that the data does successfully sync at least.
I don't think the time period was the problem - I was using "in the last 12 hours".
I was able to resolve the issue simply by removing the field called "date" and replacing it with a field called "event_date". Once I did that, the error stopped occuring.
The only other out of the ordinary detail I can add is that the layer in question is a related point layer , and features are created from a parent point.
I am now realizing Date was only the display name for this field in my data and the actual field name is "FDate" so I was not really replicating what you have. Date is a reserved SQL keyword so that could be the cause of the error. To clarify, after replacing the field with the updated name, are you able to use the relative date filter without error?
Correct, removing the field named "date" resolved the issue. Which I only thought to try after seeing the warning about reserved keywords on ArcGIS Online - I published the original service from ArcGIS Pro.