Adding Barcode feature to the PowerApps visitor registration app

Vuong Le Phong
dtlpub
Published in
4 min readJul 4, 2017

In the previous post, I demonstrated how a simple Visitor Registration app could be built using PowerApps and Microsoft Flow. One neat feature that could be added to the app is the ability to print out a barcode, which can then be scanned during check-out.

Enabling barcodes in SharePoint is very straightforward, as it is an out-of-the-box feature. In the Settings section of the Visitors list, there’s an option called Information management policy settings.

I’ll only define a new custom information management policy for the out-of-the-box Item Content Type, as I didn’t create any custom Content Type for my Visitors list.

When barcodes are enabled as part of a policy, barcodes are automatically added to the SharePoint item properties.

As seen below, barcodes were generated for the existing items:

Also note that the generated barcodes are in the Code 39 standard:

If you click on a barcode, you can see that the URL is in the following format:

https://<yoursite>.sharepoint.com/_layouts/15/barcodeimagefromitem.aspx?ID=<item_id>&list=<list_guid>

To display barcodes in the PowerApps app, I inserted an Image control into the Check-out screen and set its Image property to the following value:

https://<mysite>.sharepoint.com/_layouts/15/barcodeimagefromitem.aspx?ID=”&Gallery1.Selected.ID&”&list=15dbb353-c702–4120–85ed-f7cef708a18a

The result then looked like this.

In a new PowerApps screen, I inserted a new Barcode control.

In the properties panel of the barcode control, the BarcodeType is set to Code39.

To test the scanning function of the barcode, I inserted a TextInput control to the screen and set its Data property to the Text property of the barcode control.

Now it’s time for some testing, I’ll be performing these on my Surface Pro 3. During testing, I adjusted the Contrast, Brightness and Zoom settings of the Barcode control and swapped between the front and rear cameras.

I printed the barcode onto a sheet of A4 paper, but unfortunately the barcode control failed to scan. I persevered with many different combinations of settings, but to no avail — disappointing.

Even if I could make it work, there are still many known limitations of barcode scanning with PowerApps, including:

Barcodes should be at least 1" (2.5cm) high and 1.5" (4cm) wide.

To scan barcodes by using a phone, hold it in portrait orientation, and slowly move it from 7" (18cm) to 10" (25cm) away from the barcode.

Long barcode types (such as I2of5, which can have 15 or more characters) can give truncated or otherwise incorrect results, especially if the barcode isn’t printed clearly.

To delay running out of memory on devices that are running iOS, set the Height property of the Barcode control to 700 (or lower) and the Scanrate property to 30.

If the device runs out of memory and the app freezes, restart the app.

It’s obvious that the above limitations make the PowerApps barcode feature impractical for real world application. End users would become frustrated if the barcode scanner was unable to read the barcodes correctly in a timely manner.

Additionally, a large drawback of PowerApps is that it doesn’t support printing. It would be great if the barcodes could be printed directly from the app, instead of having to opt for workarounds such as Google Cloud Print. The good news is that Printing feature is under review at the moment, and it will hopefully be available in the near future (more details can be seen at https://powerusers.microsoft.com/t5/PowerApps-Ideas/Printing/idi-p/846)

Before making any decision of using PowerApps for your application development, you should try it out first to understand its strengths and weaknesses. My experience with PowerApps is not always great. However, I believe that all known limitations of PowerApps will be resolved over the time and it will become a powerful tool for your digital transformation journey.

That’s it for now.

www.digitaltransformation.co.nz

--

--

Vuong Le Phong
dtlpub
Writer for

An experienced Solutions Architect and Practice Lead who has had 15 years’ experience in the area of Solution Architecture, Design and Development.