Barcode scanner in Canvas app

If any kind of asset had to be counted in few organizations, they do it manually. Instead, they can
use the barcode scanner with the help of canvas app and record the assets in a faster pace.

High level resolution steps

  • We make use of Barcode scanner in canvas app
  • We store the data using Sharepoint

Detailed resolution steps

Step 1: Insert a media control type called as “Barcode reader” in canvas app as shown below:

Step 2: Add a gallery control below the barcode scanner and give the code (BarcodeReader1.Barcodes) in the item property of gallery, so that whatever barcodes are scanned will be present in the gallery.

Step 3: Create a Sharepoint list to store your barcodes – mainly barcode type & barcode values field in Sharepoint.

One sample of Sharepoint list is given below:

Step 4: Use a button to patch the gallery items to Sharepoint list. Which means whatever barcodes were scanned will be stored in Sharepoint list.

The code to patch the button is:

Copy button for small size
ForAll (          // ForAll – means for all the records in a table
                   Gallery1.AllItems,
                   Patch(
                       'Barcode Reader', // Barcode Reader – Sharepoint list name
                       Defaults('Barcode Reader'),
                       {
                           Title: Title3.Text,
                           'Barcode value':Subtitle2.Text
                       }
                   )
)

Output

Scanned Barcode:

The data that saved into Sharepoint List: