First off, this platform is amazing, for someone who’s always felt limited by standard website builders and not having programming background - this is the ultimate playground!
I’m working on an application that multiple users will be accessing simultaneously. The issue I am foreseeing is having 2 or more users on the same page, changing the same information for the same Thing (which in my case is a Bill).
The users will click “edit bill” and the current bill will be send to the “Edit_Bill_Page”. I’m thinking one user will “Save changes”, which will make changes to that bill, and the second user will overwrite those changes because they had no idea someone else was editing the bill.
Is there a way for me to not allow a second user (on a different computer) to access a page if another user is already on that page? Or even just make an element visible showing that more than 1 user is on the same page?
You can implement the “Locked” yes/no field in the data type. So, when a user visits the edit screen (page or group), you can set the field to yes. You can check this value before displaying the screen. When a user presses “Save” or “Cancel” on the edit screen, you can change the field back to no. The trouble is if the user leaves the screen in some other, uncontrolled way … Maybe someone else has a solution for that.
Another, more systematic way to tackle record locking was discussed here:
I prepared an example for this, and it seems that it works but please check it out.
When the first user goes into ‘edit mode’, the custom state of input box is set to current date & time. When he clicks the save button, the condition in the save workflow checks whether the item’s modified date is less than custom state’s time.
As Nigel said, you have to add the logic what happens then also from UX point of view - the user should be notified about that. I can imagine that Bubble could also show the changes made by the other user.
Hmmmm, no, current date is offset. But set by the devices time. I was wondering more about the modified date. So if it was modified in another time zone. But thinking about it, that should work as everything should get converted to local time in the same way at the same time.