Summary
In ArcGIS Survey123, the barcode question type is displayed in the survey form with a text box and a 'Scan barcode or QR code' icon by default. Field workers can either manually type or tap the 'Scan barcode or QR code' icon to scan a barcode with the device’s camera, and the value read from the barcode is displayed in the text box.
With a single barcode question, there is no way to identify whether the data is scanned or manually entered. This article provides the workflow to differentiate between manual and scanned data entries for barcode questions in ArcGIS Survey123 by configuring the XLSForm in ArcGIS Survey123 Connect. This is useful if field workers are unable to scan barcodes in certain locations, and these entries must be identified among the survey results.
Procedure
- Open the survey’s XLSForm in ArcGIS Survey123 Connect.
- Add a barcode question type and set the appearance to minimal. Refer to ArcGIS Survey123: Barcodes for more information. The default barcode question is displayed with a text box and a 'Scan barcode or QR code' icon. By setting the appearance to minimal, the text box is removed from the display and prevents manual entries of the barcode question.
- Add a text question type. In the calculation column, type the formula provided below and replace <field_name> with the name of the barcode question in the name column.
${<field_name>}
The formula configures the text question to auto-populate the barcode question value when a barcode is scanned.
- Add a calculate question type. In the calculation column, type the formula provided below and replace <field_name> with the name of the barcode question in the name column.
if(string-length(${<field_name>})>0,"<variable1>","<variable2>")
The formula configures an additional field to be created in the data table that identifies whether the data is manually entered or scanned. <variable1> and <variable2> are the texts to distinguish between manual and scanned entries. In this example, <variable1> is 'Barcode' and <variable2> is 'Manual Entry'.
- In the hint column of the text question, type the formula provided below and replace <field_name> with the name of the calculate question in the name column.
Source: ${<field_name>}
The formula configures the text question to display 'Barcode' or 'Manual Entry' above the text box of the text question, depending on the method of data entry.
The sample survey's configured XLSForm spreadsheet is shown below.
- Save the spreadsheet and in Survey123 Connect, click Update survey from XLSForm spreadsheet . Click Publish survey to publish the survey.
- Open the survey in the ArcGIS Survey123 web app and navigate to the Data tab to view the survey submissions in the data table.
In the data table, the additional field created from the calculate question type displays whether the data is manually entered or scanned from a barcode. In this example, the 'assetIDSource' field displays 'Manual Entry' or 'Barcode' to distinguish between manual and scanned data entries.
Displayed below is the sample survey form with the minimal appearance barcode question and text question in the Survey123 field app.
The data table below displays the manual and scanned data entries in the ArcGIS Survey123 web app.
Note:
The empty barcode fields in the data table also indicate manual data entries.