Barcodes

The barcode question type allows users to capture barcode data in a survey. Users select the Barcode button to scan a barcode with the device's camera. The value read from the barcode is displayed in the text box.

A scanned QR code tag in a survey

By setting the appearance to minimal, a barcode question displays only the button to start the scanner. The text box that contains the barcode value is not shown.

Minimal appearance for a barcode question

The following example demonstrates how to add a barcode question with minimal appearance to a survey:

Barcode question type in XLSForm

You can increase the accuracy and performance of barcode scanning on Android by enabling enhanced camera features. In the Survey123 field app, select Settings > Privacy and Security and turn on Enable enhanced camera features. Enhanced camera features use Google ML Kit. On iOS devices, the Apple built-in Vision API for barcode detection is used by default. For more information, see Machine learning.

Barcode types

The barcode question type supports many one-dimensional and two-dimensional barcode types. You can specify the barcode types users are allowed to scan in a survey by adding the barcodeType parameter to the body::esri:style column in the survey worksheet. You can increase the reliability and performance of barcode scanning by limiting the number of barcode types users can scan. For example, if users are required to scan an asset tag that is always a QR code, set barcodeType=qrcode. The barcodeType parameter accepts the following values:

  • all—All supported barcode types except code39 and pdf417
  • 1d—All one-dimensional barcode types except code39
  • 2d—All two-dimensional barcode types except pdf417
  • One or more barcode types, separated by commas, for example: barcodeType=aztec,maxicode,qrcode

The barcode types supported by Survey123 are listed in the following table:

1D or 2DBarcode typeXLSForm syntax

1D

Codabar

codabar

Code 39*

code39

Code 93

code93

Code 128

code128

EAN-8

ean8

EAN-13

ean13

ITF

itf

UPC-A

upca

UPC-E

upce

UPC EAN Extension

upceanextension

2D

Aztec Code

aztec

Data Matrix

datamatrix

MaxiCode

maxicode

PDF417*

pdf417

QR code

qrcode

RSS-14

rss14

RSS Expanded

rssexpanded

* Code 39 and PDF417 barcode types must be specified individually, for example: barcodeType=code39 or barcodeType=pdf417.

When the barcodeType parameter is not provided, all supported barcode types can be scanned by default except aztec, code39, datamatrix, maxicode, and pdf417. Users can manually select these barcode types in the field app by selecting the Settings button in the barcode scanner. Barcode types can not be selected in the web app.


In this topic
  1. Barcode types