Row being overridden from a user whose app isn't synced

Hello,

I have an app where if two users are on the same page and one user claims the rental, then the other user can override that if they are on the same view, which triggers the rental because their app hasn't synced even though I have the App to only work online. Just wondering if their was any way to prevent this? I've tried using automation and behavior and nothing seems to work

0 3 95
3 REPLIES 3

I can explain a bit further, two users are on the app at the same time. One user goes clicks on a link, which takes them to a form to fill out and upon saving it triggered with the automation to reserve that rental for them. The other user hasn't synced the App yet and can now go into the form and reserve the rental for themselves, overriding what the previous user did because it's still shown as available since it hasn't been synced. I just assumed that this was a limitation of AppSheet since it cannot handle race conditions so there isn't a viable solution for this within AppSheet itself and this was just a limitation of it's functionality. Just wondering if I need to just create a microservices Application instead for this in order to handle the traffic in real time properly. Sorry if this is too wordy

If you are using a SQL back end, you could consider putting a trigger on the table to at least stop the overwrite and blow-up the second transaction. Nasty solution, but the appsheet architecture does have it's limitations. 

There is no way to prevent this, as it's an emergent property based on the core functionality of how app sheet handles connecting to the internet and maintaining the database.

AppSheet's designed for asynchronous activity, which means you could be in the middle of nowhere with no internet service and the app will still work; when you eventually get an internet signal, then all of that data will be pushed to the cloud and everything will be updated.

This is great if you are in that type of situation... But to be honest, the vast majority of the people that use AppSheet apps are in an always-on internet environment. So in that sense, it would be much nicer if the app would function similarly to how a Google sheet functions - in the sense that two people can be editing the same file, and live see the edits as they are made.

  • A couple of years ago Praveen was doing a Christmas pow wow live stream and he explained why app sheet is largely unable to operate that way.  (There's a copy of my YouTube channel if you want to check it out)

_____________________________________

So what do you do?

The best option I've come up with is to create a flag system that operates through automation. The basic idea is:

  • every time a record submitted to the table, it checks to see if the items selected has already been selected in the database
  • If it has, it flags the duplicate record and notifies whoever needs to be notified.
  • So whoever is the first person to submit the record into the database, wins. ๐Ÿ˜‰

In this way I can have multiple people operating on the same database, without worries of duplicates; and whenever there IS a duplicate claim, whoever's not the first person will receive a notification or email or something notifying them that their record didn't go through.

  • Then you just got to create some way for them to adjudicate what to do in this situation, and make formatting rules so all of this is really apparent that there's a problem and it needs to be fixed.

Not as nice as having live edits visible to everybody as they're being made, but this works really well. ๐Ÿ’ช

Top Labels in this Space