I’m having a problem with sync. The app is a logistics type app where a job goes through various status changes to completion e.g. awaiting allocation, allocated, collected, delivered. If a coordinator makes a change to a job that is already in progress it’s possible for updates that have already been made by the driver to get overwritten. Is there a way to force a sync before allowing an edit to be made?
@David_Jones Hi David, could you give us more information about the app? Specifically, what are the app’s sync settings (offline mode, delayed sync, sync on start, ect.). Also, how will the app be used? For instance, will the drivers use the app offline, will multiple people use the app and modify its data simultaneously, etc.?
The sync settings are: The App Can Start When Offline=On Store Content For Offline Use=Off Delayed Sync=On Sync On Start=On Automatic Updates=On Delta Sync=On
The basic operation is: 1 - Coordinator creates new job - Status=Awaiting Allocation 2 - Coordinator calls Rider to allocate the job - Status=Called Rider 3 - Rider goes to collection point and records collection time, name and signature of person collected from and updates Status to Collected 4 - Rider delivers
and records delivery time, name and signature of person delivered to and updates Status to Delivered
I think that what sometimes happens is that the rider has done their bit OK (collected/delivered) but for whatever reason, the coordinator goes in to the job and changes something but without doing a sync first.
So if the Rider has already updated the job to Collected but the coordinator has the job still showing on their screen (usually PC/Laptop) as Called Rider and then makes a change without syncing first, their version of the record then becomes the latest and wipes out the information that the rider has already entered.
So it looks to me like I have to have a way of making sure that before anyone makes any change to a job it is definitely the most up to date version that they make changes to.
But I can’t see how I can enforce that.
I’ve just proved that my theory is correct.
Can’t believe I didn’t test this out before!!
On my laptop I created a new job and set the status to Called Rider and then left that screen open with the job at that status.
Then on my phone I took the job through to delivery status with everything filled in and signatures captured.
Back on my laptop, without syncing first, I went in to the job and changed the status to collected.
Back on the phone I did a sync and of course the job has now gone back to Collected status with all the collection and delivery info I entered earlier wiped out.
This is obviously correct based on the timestamps of the latest versions of the record.
But I have to find a way of ensuring that before any sort of edit is made to a record that is displaying in front of someone, the most up to date version of that record is fetched first.
I don’t see how to do that.
@David_Jones Hi David, your theory is certainly correct. This is actually a fairly common scenario, and the automatic update sync setting was designed for this purpose. When automatic update is enabled, the app will silently update its data in the background at regular time intervals. Right now, the interval is 30 minutes. However, we recognize that many users such as yourself would like to reduce the interval, especially if you have multiple app users who need to work with the app frequently.
I believe @praveen is looking into allowing app builders to select smaller time intervals via the app editor.
Does this automatic update work when accessing via a web browser?
@David_Jones I have been testing my logistics app in the browser and it’s been auto-syncing roughly every 30 mins. I’d be interested to hear more about being able to update the auto sync. If it were a perfect world, I’d like to be able to set mine for every 5 minutes to try and eliminate the risk of the orders being overwritten. This is, and has always been my biggest concern with AppSheet. For my purposes, a quicker sync rate is a must.
@David_Jones Hi David, automatic update works the same way whether on mobile devices or in browsers.
@Harry I raised a support ticket as my problem was getting worse with some records that continually reset themselves back to their original state.
I had help from Praveen and we used the audit log to discover that there is a user who is accessing via a browser and has queued data to sync but there has been a minor change in one of my lookup tables so the sync partially fails.
Unfortunately it fails after it seems to have submitted the actual data changes.
So I need to get those changes discarded from the user’s browser.
Hopfully talking him through that today.