Barcode scanning for few items once by once to a list, then sync instead of syncing immediately

Hi all,

I wanna create an action or a behavior to invoke the barcode scanner, so it behaves like a supermarket checkout and I am successfully to do it after taking a reference of this article: Barcode Scanner action

Additionally, I would like to scan a series of barcode first, which means a list of items, then upload or sync all of the data manually instead of upload or sync the data immediately after scanning one item after one. Just like the photo shown below:

Sorry for my poor expressions and limited English level.

Thanks in advance.

First note: Please consider to set the [Product Barcode] column to required.
And under UX --> Options --> turn on “Advance forms automatically”.
This will open up the scanner immediately without having to click on the scanner Icon.

To your question:
Under Behavior --> Offline/Sync --> enable “Delayed sync” and disable “Automatic updates”.
This will queue up the scanned Barcodes. image
When you are finished with the series of Barcodes, you can manually sync.

Or: you can attach an Action to your form under Event Actions Form Saved.
This Action would automatically force a sync after you are finished with the series of Barcodes.
The Action should be “App: go to another AppSheet app” with the Target:
CONCATENATE("#view=Your_Table_View&at=",NOW() + 1)
Under “Only if this condition is true” you can set a condition. For example you could Add another column at the end of your Barcode Form, letzt say [Sync] with one ENUM value “Save and Sync”.
The condition in the Action would then be: ISNOTBLANK([Sync]).

Finally you will have:

  • Open the Barcode scanner
  • Scan a Barcode
  • Open the form again automatically
  • Scan as many Barcodes you like
  • At the last one click on “Save and Sync”
  • The App syncs and brings you to the Table view.
3 Likes

But one question remains: Why do you want to queue up the scanned Barcodes? :thinking:
What is your use case?

Thanks, Fabian. Let me try this.

The network connection is not good enough. If the data sync immediately after scanning a barcode, they need to wait 2 to 3 seconds for syncing, and then further scan next barcode. They think it’s a kind of wasting time for waiting because of the network problem. Btw thanks a lot, Fabian.

If that’s all, then under Behavior --> Offline/Sync --> just enable Delayed sync and enable Automatic updates.
The App will then sync in the Background without any waiting / interaction by the user.

3 Likes

Wow. I can’t believe it. It works perfectly and what I prefer. Thanks a lot, Fabian.

1 Like

You’re welcome :blush:

I’m happy that it works for you, can you please share the steps used in creating the app including spreadsheet data structure. I have tried many times to replicate such an app but so far without success.

Many thanks

Hi App,

Sorry for late reply. I was out of town and didn’t check the notifications in AppSheet Community till now.

I use the sample app “Inventory Management” as a base for trial, and then create a new sheet in excel (cloud drive) and a table in AppSheet called “Scanning” with only 3 columns, Timestamp, Barcode and Quantity.

Timestamp: DateTime (Type), set as a key, Show(off), Initial value [ =now() ]
Barcode: Text (Type), set as a label, Show(on), Search (on), Scan (on)
Quantity: Number(Type), Show(off), Initial value [ =1 ]

After that, create a slices named “Barcode”.

Source Table: Scanning
Slice Columns: _RowNumber, Timestamp, Barcode
Update mode: Updates (tick), Adds (tick)

Finally, create a UX.

For this data: Barcode (slice)
View type: Form
Auto save: On
Auto re-open: On

If you need manually click synze button as what I need, you can refer to Fabian’s reply.

Behavior --> Offline/Sync --> just enable Delayed sync and enable Automatic updates.
The App will then sync in the Background without any waiting / interaction by the user.

Thanks.

1 Like