Barcode scanner control (retired) in Power Apps

The legacy control for scanning barcodes, QR codes, and data-matrix codes on an Android, iOS, and Windows device.

Important

The barcode scanner control is retired as it is replaced by the barcode reader control. While the legacy barcode scanner's existing functionality will continue to be supported in future versions of Power Apps, the barcode reader includes the latest improvements and should be used where possible.

Prerequisites

The barcode scanner control is retired and needs to be enabled to show up in the insert pane.

With your app open for editing in Power Apps Studio:

  1. Open Settings
  2. Select Upcoming features in the left-hand menu and select the Retired tab
  3. Turn on the Legacy barcode scanner setting

Description

The control opens a native scanner on an Android, iOS, and Windows device. The scanner automatically detects a barcode, a QR code, or a data-matrix code when in view. The control doesn't support scanning in a web browser.

Note

The barcode scanner control is supported on an Android, iOS, and Windows device. All other platforms will show a warning that some features of the app won't work.

Key properties

Value – Output property that contains the text value of the code that was scanned most recently.

Type – Output property that contains the type of the code that was scanned most recently.

OnScan – Actions to perform when a barcode is successfully scanned.

OnCancel – Actions to perform when a barcode scan is canceled by the user.

BarcodeType - The barcode type to scan. You can target multiple barcode types by concatenating them. Ex. BarcodeType.Code128 & BarcodeType.Code39 Default: Auto

PreferFrontCamera - Whether the front-facing camera, when available, is used for scanning.

FlashlightEnabled - Whether the flashlight is enabled automatically when the scanner is opened.

Additional properties

Text - Text that appears on the button that activates the scanner.

BorderColor – The color of a control's border.

BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – The thickness of a control's border.

DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).

Height – The height of the button that activates the scanner.

Tooltip – Explanatory text that appears when the user hovers over a control.

Type - The type of code that was detected in the scan that succeeded most recently.

Visible – Whether a control appears or is hidden.

Width – The width of the button that activates the scanner.

X – The distance between the left edge of a control and the left edge of its parent container (screen, if no parent container).

Y – The distance between the top edge of a control and the top edge of the parent container (screen, if no parent container).

Accessibility guidelines

The same guidelines for the Button control apply to the Barcode scanner control because it's a button that launches the scan.

Visual alternatives

  • The barcode scanner is a button that doesn't display the scan result. Consider showing the scan result with a Label control. Set the label's Text property to the barcode scanner's Value property. Set the label's Live property to Polite so that screen-reader users are notified of changes. This change makes the scanned value accessible to everyone, irrespective of visual ability.

  • Users who have visual and motor disabilities might prefer not to point the camera at a barcode. Consider adding another form of input, such as a Text input control, for users to enter barcodes.

Barcode Availability by Device

Barcode Type Android iOS Windows
QR_CODE
DATA_MATRIX
UPC_A
UPC_E
EAN_8
EAN_13
CODE_39
CODE_93
CODE_128
CODABAR
Databar Omnidirectional
Databar Stacked
GS1-DWCode
ITF
Interleaved 2 of 5
RSS14
PDF_417
RSS_EXPANDED
MSI
AZTEC

Note

PDF_417 and AZTEC aren't supported in Auto mode.

See also

Limitations of controls in Power Apps