How to manage simultaneous use

i have an application to manage orders.
More then one person can use the app with the same right.
If two people have the app opened, they can do the same thing in the same time.
The main issue is if they go into an item detail view trying to create an order for it.

I have build a simple check to hide the action if it is supposed that you shouldn’t press.
But if you are already in, without sync, this is not enough to prevent occasionally misunderstanding


I’m afraid you can’t avoid like that because your users can have the same data with their devices. Though you can check for example with a scheduled report if duplicate orders are created… but that will happen later, not when they are filling/saving the form.

1 Like


Doesn’t exist some tricky way neither? Maybe not a real solution but something that at least can help?
Prevent duplicate order open for the same ID? Like an error when the second user press “save”

Yes, one possible workaround is you create your own ID formula which prevent the duplicate entry.

Actually my ID is UNIQUEID() of course to be unique.
So i have
[ITEM Serial Number] that is unique in his database but obviously not in the order table

Can you elaborate your tables with names and relationship between them? Who is parent and who is child etc.

A potential workaround is you could add an extra logical column ‘in_use’ against one or more parent tables as appropriate.
Then create an action that when your users view / update etc (force the trigger) the logical field in use becomes true, and false when they create the new record (or discard changes).
From there just add the check “in use = false” criteria to potential double ups
I.e. record it against the customer and/or job to filter down to the targeted transaction scenario

Hope it helps
Edit: if it’s in use make the data read only with a pop up of why

Table1: database of truck
Table2: order(trip of these truck).

In table 2 the key is an uniqueID but the same truck can do a lot of orders, not just 2 in the same time of course. If i create an order still OPEN, you cannot create another order with the same truck (the action “create order” is not visibile anymore at this point to prevent human mistake).
But my colleagues can create in the same time another order because they don’t see mine yet, if i’m still in the form. They need to wait some second that i save and then manually sync to update.

One method could be 1 action “reserve truck” (set available to FALSE), then open the order. So the second user can’t opens an order on the same truck. But will this action effects my colleagues app or still we have the sync issue?

Hi Mark,
Create an audit table to log intermediary transactions
Log the order id, user logging the order and the truck here as a record with the logical ‘in_use’ column.

Then have the action check the audit log on navigating between viewing the customer and raising an order forms if the value is true/false.

Hope it helps
Edit: then set the in use value to false once they log the order.
Also you don’t need to stop them entering an order, you can then notify them like ‘note: Mark is currently raising a similar order’. Prompt staff conversation of whether it’s a duplicate.

Before we go forward, could you explain a bit what is your own “definition” of duplicated orders?
I understand there is multiple unique trucks in table 1, that stands as parent. And then each distinct truck should be able to have multiple orders. In this context, what is duplicated order for you?

I mean, two order “open” at the same time.
One truck can’t go in two different place. Has to go in one city, then go back, close order. The day after can go in another city with another order.
You don’t have the action visible “create order” if one order is ON GOING already.
You can circumvent this rule if you create the order from another computer without sync, because “your” app is not update in real time and you can see this truck still in the park lot.

Thanks for the help;
it’s a bit difficult to me to understand what you are trying to suggest

My understanding based on your comment.

So in case a truck have One pending (open) order, user is unable to add new order AT ALL, unless he close this order first.

Once the order is closed, meaning there is no order with OPEN status, then you can add new order to this particular truck?

Is so, workaround is fairly easy.

Yes, that’s it and i already have a way to prevent this.
valid_if on the action so you don’t se the action; but it works only if you have the app synced

Hi Mark,
That helps, thanks.
I’ll try to be clearer with what I’m proposing.

Correct me if I’m mistaken:
You need to add a check between when users are opening a blank order that no other ‘blank’ orders are currently being generated for that date + truck.
We can do this by recording a temporary transaction at the time they click to start a new order, as follows…

Have them input the truck id and date for order firstly, and then navigate them through to a form for the rest of the details.
When they navigate have those values saved to an audit table, with a unique audit id and ‘pending’ status.

Back to the order itself, have the audit values we got previously added to the form and also save the audit id to the order record to delete it later.

Now when the next user tries to press the same button the app stops them by looking at the audit log and finding a pending status for that truck AND date.
Seek audit_table FOR {truck} + {date} & ‘status=pending’
(Example expression)

Then once the pending order is lodged by the first user they also change the status to ‘done’, or even just delete the audit record.

Please think about whether you want that second user to be unable to log the order because it’s not feasible to your business, or if you’d rather empower them to be aware of the first users inbound order so they can discuss it as a team (maybe the truck can make two nearby orders).
Edit: On second thoughts I recommend deleting the audit record once they log their order, keep your data slim for faster processing.

1 Like


To make sure the app is synced when the user access to it, first safe guard is to set the app to sync “on starting app” all the time.

Additional safe guard should be using deeplink so that the app start to sync when the user change the view from A to B.

On this article, you can find how to construct " Manually Constructing Deep Links". Give only option to user to change the views from A to B by using action you generated which is connected with Deeplink expression, which fire the SYNC all the time.

Appsheet is connecting to database, but they are not REALTIME database.

This should be possible workaround I could come up with.


The suggestion from @recei_Plumber is valid as well, I believe.

The beauty of Appsheet is there are bunch of workaround to do the same stuffs.

It is upto your choice, @Mark_11

The solution of @recei_Plumber is kinda fascinating but also very tricky because of many cases possible in my company (some truck can have more than one order per day, some other not and it’s totally random).
Also is not a matter of life and death at the moment, i have prioritisation based on maybe in the future i would try something like that and i would ask more about this. Thanks a lot.

For the solution of @tsuji_koichi my app already has all the Sync things enabled; the problem is we work 24/7 with the app opened, so we don’t re-open the app

Sure, then only workaround I come up is the one I explained, i.e. the user change the view, then app starts to sync. Thats all from myself.

1 Like

Hi Mark,
Glad you found some use to my solution.

The solution is really just an example of the SYSTEM you can use to resolve the issue, because no one knows the VARIABLES of your business better than you would.

I suggest you map out what criteria you need the audit log to capture for it to be effective, then add them.

Such as now I would also have the first user log the estimated time value (hours),or the allocated delivery times to the audit log before opening the blank form.

Now the audit log is asking whether the next users’ order time clashes with a ‘pending’ order :wink:.

When you’re mapping out the variables I suggest you think about IF AND OR phrases.
These sorts of operational issues can usually be boiled down to such expressions.

1 Like