Offline and sync with multiple users

I have an app that has multiple tablets that need to function in offline mode while out in the field, and they sync the data at the end of every day. Each tablet has approximately 50-70 new entries. Having multiple devices sync we are currently losing data. Are they overwriting one another? The key is NOT the row number, and is a UNIQUEID.

We can add mobile data to the tablets, but would prefer not to if we can help it.

Has anyone had any issues with this? 

Solved Solved
1 1 54
1 ACCEPTED SOLUTION

In AppSheet the last edit to a record is the winner.  This means that if two offline users edit the same record, whoever is the last person to get their upload to the cloud - wins.  

  • The first person's edits are lost

This is because, if you think about it, when user2 was making there edits to the row... their device doesn't have the data from user1 - because they haven't synced their data with the cloud, and user2 hasn't downloaded that data - so when the data from user2 is uploaded, it "appears" that user1's data is erased.

_______________________________________________________________________

The solution

  • Each user needs to be modifying only records that they've made (on their device). 
  • Users cannot edit the same records

Sometimes this means that you need to create an additional data submission table, and create an automation bot that then takes these records and figures out how to apply the actual changes to the real database. 

This means that the bot, which is running with the cloud's database (which is the "source of truth" and always considered the most up to date version), will have user1's data and can reject user2.

  • So user2's record could trigger a conditional branch for duplicates, and send an email or something to the user letting them know they tried to edit something that's already been modified.  Or whatever.  lol  You get the point.  There's a system installed that's "smart" and handles these situations.

______________________________________________________________________________

You might find some additional information in the following video helpful (though it's not necessarily the same issue).

 

View solution in original post

1 REPLY 1

In AppSheet the last edit to a record is the winner.  This means that if two offline users edit the same record, whoever is the last person to get their upload to the cloud - wins.  

  • The first person's edits are lost

This is because, if you think about it, when user2 was making there edits to the row... their device doesn't have the data from user1 - because they haven't synced their data with the cloud, and user2 hasn't downloaded that data - so when the data from user2 is uploaded, it "appears" that user1's data is erased.

_______________________________________________________________________

The solution

  • Each user needs to be modifying only records that they've made (on their device). 
  • Users cannot edit the same records

Sometimes this means that you need to create an additional data submission table, and create an automation bot that then takes these records and figures out how to apply the actual changes to the real database. 

This means that the bot, which is running with the cloud's database (which is the "source of truth" and always considered the most up to date version), will have user1's data and can reject user2.

  • So user2's record could trigger a conditional branch for duplicates, and send an email or something to the user letting them know they tried to edit something that's already been modified.  Or whatever.  lol  You get the point.  There's a system installed that's "smart" and handles these situations.

______________________________________________________________________________

You might find some additional information in the following video helpful (though it's not necessarily the same issue).

 

Top Labels in this Space