Working with Barcode Scanner in PowerApps

By | May 22, 2019

Introduction:

Barcodes provide a convenient way to pass information from the real world to your app. We see the use of barcode and barcode scanners in our everyday life i.e. while shopping, renting a car, attending major events, flying and so on. They’re in our social media apps and on store windows.

Using Barcode Scanner in Power Apps we can get data or can open URL from Barcode or QR code.

Let’s just start exploring this media by simply creating a Barcode Scanner App to get data and open URL from Barcodes or QR code.

In this app we have used two scanners:

  • To get Scan information from Barcode or QR code.
  • Open URL that is present in Barcode or QR code.
  1. Now select the “Barcode Scanner” media from the list of media as shown in below screenshot:
  2. After Barcode Scanner gets added in screen, use the formula on “onScan” property of Barcode Scanner to get the value of Barcode or QR code while scanning code. Then using “Set” method of Barcode Scanner scanned value; set in “scanvalue” variable.

Set(scanValue,BarcodeScanner1.Value)

  1. Select “Label” and set “text” property of label as “Scan Result:”

  1. Select another “label” to display the result of Barcode Scanner. Then set “Text” property value as “scanvalue” variable that contains scan value as shown below:

  1. Now add another scanner on the screen to open a link that is present in the code. Now set “Text” property of BarcodeScanner2 as “Scan and Go”:
  2. Now set formula on “onScan” property as “Launch(BarcodeScanner2.Value)” to open URL that is set in the barcode or in QR code. After this save the app.
  3. Now open an app in mobile to scan barcode or QR code. Initially the app will ask for camera permission because one can scan barcode or QR code by using mobile camera. Next click on “Allow”.
  4. After clicking on “Scan” button mobile camera will scan barcode or QR code as shown below:

  1. Scan information is displayed on mobile.
  2. To open particular URL Click on “Scan and Go” Button. In the below example, we have used QR code related YouTude video. After scanning, the YouTube app will open in mobile and the video will start playing.

Conclusion: Using Barcode Scanner media in power apps we can easily scan Barcode or QR code.

2 thoughts on “Working with Barcode Scanner in PowerApps

    1. inogic Post author

      Yes, you can store scanned information in database as Excel. For this, you need to follow the steps given below:

      1. Create a table(ScanInfo) in Excel with three columns.
      ScanData: Scan data from Barcode or QR code.
      Who: User who use this App.
      When: Date and Time when Barcode or QR code get scanned.

      Barcode or QR Code

      2. Create a Canvas App and connect your Excel sheet that is stored in cloud-storage account. You can refer this article to connect Excel to PowerApps.
      3. Now select ‘Barcode Scanner’ media from the list of media. Use the below formula on ‘onScan’ property of Barcode Scanner to get data of Barcode or QR code while scanning code and store that data in Excel table(ScanInfo) to respective columns(ScanData, Who, When) using Patch method.
      Patch(
      ScanInfo,
      Defaults(ScanInfo),
      {
      ScanData: BarcodeScanner1.Value,
      Who: User().FullName,
      When: Now()
      })

      Barcode or QR Code

      By using above formula, you can create scan data record in data source.

      Hope this will help you.

      Thanks!

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *