Understanding Barcode Questions in ArcGIS Survey123

23713
62
05-16-2016 07:58 PM
IsmaelChivite
Esri Notable Contributor
7 62 23.7K

[Last updated November 3, 2021]

Seneca Resources Survey123.jpg

A barcode is an optical machine-readable representation of data. A lot of things around us have barcodes. You will find them in virtually any packaged item you buy, in the back cover of books and most likely somewhere in the laptop, its power adapter, or the PC you may be using right now.

Typically, barcodes are attached to things using a sticker, or simply printed on them. You can put any data you want in a barcode, but generally they are used to unequivocally identify the item.  Barcodes are designed to encode data in a way that can be quickly scanned using either a barcode scanner, or through the camera of your smartphone.

In the image, a barcode has been placed in the back of a road sign. The barcode uniquely identifies the asset, but also carries information about the installation date, manufacturer and other important information.

An inspector, using the Survey123 field app, can quickly scan the barcode and load all the asset information into the form. At that point, the form can be completed and submitted.

Types of barcodes


There are multiple flavors of barcodes They are organized into two categories: linear and 2D (matrix) barcodes.

The original barcodes where all linear. They were invented in the 1960's, popularized in the 1970's and still the most commonly used today. Here is a linear barcode representing the value 03600029145

 

201025_UPC.png

 Two-dimensional barcodes can encode more information. A popular one these days is the QR code, which you may have already used from your smartphone to quickly access a web site, or to download a mobile app.

 

201050_QR.png

 There are lots of different types of barcodes, even for each of these two categories. Choosing one type or the other will depend on what type of data you want to encode (not all types support international characters for example), the size of the data, the amount of space you have for the sticker, etc

Another important aspect before choosing the barcode type to use is licensing. Many barcode styles are patented and you cannot use them to print your own data.  You can learn more about the different types of barcodes in Wikipedia

From a practical perspective, if you would like to create your own barcodes, a safe bet is to go with a 2D style, as it will give you good flexibility to store data of different sorts or one in the public domain, such as Aztec or QR Code.

There are different ways to print barcodes. To start playing around a bit, I personally liked qr-code-generator.com and also barcode-generator.org. You will also find API's, to create these barcodes programmatically, as well as solutions of all sorts to print stickers: in bulk, from a pocket printer, to print waterproof barcodes etc  There is really a world around barcodes. If you are hardcore enough you will even find people who will tattoo them on you.

 

Barcodes in Survey123 (The Basics)

 

If you would like field users to be able to scan a barcode and get the data added to your survey, you need to add a barcode type of question. As shown in the screenshot below, the XLSForm specification includes a barcode question type.

IsmaelChivite_0-1635957158862.png

Barcode questions, by default, are shown in your form as an input box with a barcode scanner button o the side. Users can either manually enter text or tap the scanner button to trigger the device camera.  By simply focusing on the barcode the barcode will be scanned and the data from it added to the form.

Survey123 supports the following barcode types: QR Code, Code 39, Code 93, Code 128, EAN 8, EAN 13, UPC A, UPC E, UPC EAN Extension, Aztec, Codabar, Data Matrix, ITF, MaxiCode, PDF 417, RSS14 and RSS Expanded

 

Tap2Scan.png

 

By default, the Survey123 field app will automatically scan all barcode types except Code-39 and PDF417. If you need to scan Code-39 or PDF417, go into the scanner dialog settings and activate the format you are targeting. Your barcode preference will be remembered.

 

To help you get started, Survey123 Connect includes a Barcodes survey design sample. Open Survey123 Connect, click on New Survey, and then look in the Samples category. Publish the survey and download it into your device to familiarize yourself with the XLSForm syntax and the app experience.

IsmaelChivite_2-1635957823509.png

 

Minimal appearance and calculations

 

Barcode questions in Survey123 support the minimal appearance. When used, the question will not show any type of input text box. Instead, all the user will see will be the name of the question, as well as the button to start the scanner.  

201053_611FFA1 Stark Industries .png

The minimal appearance in a barcode question is typically used in combination with calculations in other questions: the barcode question is used to fetch data, and the calculations extract that data and display it to the user.

Say for example you want to use a barcode to store the Unique Identifier of an asset and the company that produced it. Just like in the barcode on the side.

We would not want to show all that information in a single field, because it would be confusing to the field user, and somewhat useless stored that way.

Using the minimal appearance and calculations you can parse the information from the barcode and present it and store it in different fields... like in the following example:

IsmaelChivite_3-1635958248833.png

If the information in the barcode is more complex, you can use a custom JavaScript function to parse its contents.

62 Comments
BrandonKeinath1
Occasional Contributor III

This is fantastic!  Thank you all for your continued development of this app and the barcode functionality.  Is the "minimal" appearance potentially device specific?  When I use the template for barcode scanning and look at the resulting survey the minimal and non-minimal barcode questions look the same.  Do I need to refresh the app from the app store?

IsmaelChivite
Esri Notable Contributor

Hi Brandon Keinath​  You certainly need to update your mobile app to 1.4.28 or newer. The app is available in the app stores.  Do not forget to submit any data you may have pending to be sent in your device before you update the app.

BrandonKeinath1
Occasional Contributor III

Thanks for the quick reply Ismael!  You're absolutely right and after updating the app I now see the "minimal" appearance.  We're using this app a lot within our organization and I'm very excited to see where it goes!

AdamDaily
Occasional Contributor II

Can survey 123 be used with an external barcode scanner attached/bluetooth connected to a mobile device instead of using the camera on the device?

MitchellProctor
Occasional Contributor II

Adam,

This is an interesting idea, but probably wouldn't work, unfortunately. The barcode question launches the camera and then scans the image(s) it takes for a readable image, an external barcode scanner likely wouldn't give the app the data in a format it can use.

GaryBowles1
Occasional Contributor III

They used to work prior to the upgrade to using the camera. We used a bluetooth scanner and it sent the text data attached to the barcode back to the survey. Not sure if this will still work but i will try it with one of our external scanners and let you know.

--gary

AdamDaily
Occasional Contributor II

Thanks. I am trying to use the camera to do this but cant seem to get the scan to work. I have tried a number of different bar code types including "any" and it just keeps telling me "scan failed, try again". I was hoping using an actual scanner could solve that.

KarenLandicho
Esri Contributor

Hi guys,

I just want to ask if it is possible to use Survey123 with password protected QR Codes. We tested several password protected QR codes but every time we use Survey123 to scan them, we are prompted by an error message "Scan failed". Hope you can help me with this.

Thanks,

Karen

JamesTedrick
Esri Esteemed Contributor

Hi Karen,

By "password protected", is the data stored in a QR code encrypted and then requires a password input in the app to decrypt?  If so, Survey123 doesn't have a capability to prompt a user to decrypt the text nor functions to automatically decrypt the text based on the answer of another field.  It should successfully scan but present the encrypted text.

KarenLandicho
Esri Contributor

Hi James,

Thank you for the response. To answer your question, yes the information stored in the QR Code is encrypted and needs a password to capture it. Scanning the password protected QR Code is always not successfull using Survey123 but when we tried a normal QR Code scanner it prompted for a password. Are you aware of any workaround for this type of use case?

Thanks,

Karen

Jesusa Poquiz‌ 

JamesTedrick
Esri Esteemed Contributor

Hi Karen,

Which application(s) did you use to scan the encrypted QR code?  In doing a bit of research, the only application that does this is the Android app QR Droid, which is doing as a feature of the app- there isn't any standard for encrypted QR codes that I can find. (Secure / Encrypted QR Codes - Stack Overflow  and QR Droid Mobi  are what I could come up with).

KarenLandicho
Esri Contributor

Hi James,

We are using QR Scanner, a free android app to scan an encrypted QR Code. I attached the screenshot of the mobile app.

       

 

Thanks,

Karen

PriscilaSamaniego
New Contributor II

Hi, Is Priscila from Ecuador. 

I have a problem, when using barcode in survey123. Performs the scan and stops the application.
JamesTedrick
Esri Esteemed Contributor

Hi Priscila,

The barcode scanning feature is a relatively resource-intensive component, as it both shows live video and attempts to analyze the image for the barcode pattern.  What devices are you using?  In the longer term, we are working to improve the barcode component and make it more efficient.

PriscilaSamaniego
New Contributor II

Hi, i tried with two mobile phones: Samsung S4 mini and Samgung A5. 

What are the minimum requirements of the mobile device, for the correct operation of bar code
JamesTedrick
Esri Esteemed Contributor

Hi Priscila,

The Samsung S4 mini is certainly at the very edge of our support.  I would expect the A5, depending on the year, to be reasonable to good performers (do you know which year - 2015, 2016, 2017 or Android version the phone currently has?).  

One thing noted by our barcode widget developer is that there are 2 methods of capture- one that uses low resolution and another that uses higher resolution; it may be that the phone can't enter the low resolution mode.  If in higher resolution mode, you may hear the camera 'click' sound as the image is taken and saved (as opposed to scanned off the video in low res).  It's also evident as a more 'stuttery' video stream.

Also, what barcode format are trying to scan?  Some barcode formats are more complex to decode than others.

PriscilaSamaniego
New Contributor II

Thanks James, I am going to try with another celphones.

JamesTedrick
Esri Esteemed Contributor

Hi Priscila,

There currently isn't a function that can separate text based on a delimiter in the XLSForm specification.   We have given a bit of thought on this, but it will be a while before we approach this with a workaround.

GaryBowles1
Occasional Contributor III

James & Priscila,

We are using the pulldata function with barcode scanning to automatically fill in data fields (See attached). This way we can extend the data that we pull from our barcodes. This is working great to ensure that we receive certain data exactly how we want and to reduce time in the field for the survey takers.

--gary

Gary H. Bowles, GISP

GIS Database Administrator | Seneca Resources

Office : 412-548-2544 | Cell Phone: 412-334-5273

AdamDaily
Occasional Contributor II

I am still unable to use the scanner in Survey 123  with an iPad. I've tried with iPhone and android phones as well with limited success. Our problem could be the bar codes are up high so you have to hold the ipad up to scan them. Also there are often 2 bar codes stacked on top of each other, so trying to use the camera to capture only one is difficult. We have external scanners (Motorola and Symbol) that shoot the single laser line at the bar code and work just fine, but I'm not sure how or if I can use those to work with Survey 123. 

JamesTedrick
Esri Esteemed Contributor

If the external scanners can connect via Bluetooth to the devices, they should be able to fill in the barcode fields.  However, they also take over the keyboard of the device; currently the on-screen keyboard does not display when the scanner is connected

PriscilaSamaniego
New Contributor II

Thanks Gary! I am going to try this. 

PriscilaSamaniego
New Contributor II
Can you recommend devices that have effective barcode operation?
We have to acquire devices for this information collection.
GaryBowles1
Occasional Contributor III

We are using the following devices in the field to scan QR barcodes and we have had no issues:

iPad mini 2

iPhone 6

iPhone 7

Samsung Galaxy S5 phone

Samsung Galaxy S6 phone

I will be testing an older ASUS tablet next week to see if we can put it into service as well.

We are also using Aulux Barcode Label maker Enterprise Edition to create our barcodes.

--gary

Gary H. Bowles, GISP

GIS Database Administrator | Seneca Resources

Office : 412-548-2544 | Cell Phone: 412-334-5273

AdamDaily
Occasional Contributor II

That is good news. These do have Bluetooth. I have connected a Motorola MC55 via Bluetooth to our iPad. From there I am launching Survey 123 and my data collection template. However when I go to "scan" it still is activating the iPad camera and not giving any indication it can use the external scanner. I tried scanning with the Motorola but no data carries over into my survey template where the bar code would appear. 

AdamDaily
Occasional Contributor II

I noticed our handheld scanner is running Windows mobile 6.1 pro and platforms supported for Survey 123 appear to begin at Windows 7. I'm wondering if I updated windows on this device would it work, or is there a setting I have overlooked and need to try first before going this route.

JamesTedrick
Esri Esteemed Contributor

A Motorola MC55 isn't a scanner per se, it's a mobile device in its own right.  While it has bluetooth, it probably won't act the same way as a dedicated scanner would.

JamesTedrick
Esri Esteemed Contributor

There's a significant difference between Windows Mobile & Windows - the last version of Windows Mobile was 6.5 (and in this type of device, the next appropriate version was Windows Phone 8, which would be unlikely to run on the device).  Even so, it probably would not connect to the iPad in a way to transfer the barcode information.

AdamDaily
Occasional Contributor II

Thank you for the reply. I don't suppose  loading/running survey on the Motorola would be an option either even if we updated to windows 8? We would like to use survey, just having a hard time finding a work around solution since the iPad cameras will not read the bar codes. 

DanielMcIlroy
Occasional Contributor

Is there a way to set the barcode scanner to "all types" by default?

erica_poisson
Occasional Contributor III

Is the barcode scanner compatible with driver's license?

BrandonArmstrong
Esri Regular Contributor

Hi Erica, yes, the specific barcode type for Drivers License is 'PDF 417'

erica_poisson
Occasional Contributor III

When I have my Survey123 app set to accept "all barcodes", I end up with a garbled input that matches a alphanumeric code on the back of my license. When I change the barcode type specifically to PDF417, I am unable to scan my license at all.

Are there additional steps I need to take within my XLS form before the scanner will function properly? If there are, do you know of any resources detailing how to break out the content from the barcodes?

Thank you!

BrandonArmstrong
Esri Regular Contributor

Hi Erica, you will want to specifically select the PDF 417 (as you have done).  I have found that attempting at different zoom levels (for me, zoom level 3 with an iPhone 😎 can make a difference.  In addition, ensuring you have ample light when taking the photo (consider flash) can help.  We are currently looking to improve the ease of scanning PDF 417 barcodes.

As for parsing out the string of information that is returned, we do not currently have an out-of-the-box method.  Some users have been playing around with building a custom JavaScript function, that would be used with the puuldata function.

More information related to custom pulldata() JavaScript functions can be found in our Early Adopter Community

deleted-user-8TVt6oc0ewsX
Occasional Contributor

Is there a way to use a BARCODE to pull up a record from a feature service?  I have a feature service of poles.  One of the columns in the Feature Service is the BARCODE#.  I want the fieldworker to scan the barcode and show the correct record (fields and geopoint/map) corresponding to the BARCODE# stored in the Feature Service.  I can get this to work with pulldata() and a CSV but want to use a Feature Service instead.  Is this doable?

JamesTedrick
Esri Esteemed Contributor

Hi Jonathan,

We have beta functionality in the Early Adopter Community that could meet this requirement.

deleted-user-8TVt6oc0ewsX
Occasional Contributor

Thanks, I will take a look.  Any thoughts/tips on where/how to find the barcode piece in the Beta that would help me?

JamesTedrick
Esri Esteemed Contributor

The link should take you to the appropriate document- custom JS functions.

deleted-user-8TVt6oc0ewsX
Occasional Contributor

Thanks James, any tips/advice on how the "calculations" would look like to read a barcode and populate the form from the Feature Service (including the geopoint) to do this?  Let me know if you would be able to call me to discuss 520-724-2678

CPoynter
Occasional Contributor III

Hi Gary,

Could you send the attachment you mention here please or outline your process. Interested in using Bar Codes to auto-populate forms.

Craig

GaryBowles1
Occasional Contributor III

Craig,

I think this is what I had sent. Hope it helps.

--gary

Gary H. Bowles, GISP

GIS Database Administrator | Seneca Resources

Office : 412-548-2544 | Cell Phone: 412-334-5273

CPoynter
Occasional Contributor III

Hi Gary,

Please send attachment to cpoynter@csu.edu.au. I still cant see it attached here.

Regards,

Craig

EddyClark
Occasional Contributor

Does the barcode scanner have a character limit?  I have two barcodes, both Code_39, one with eight characters (plus * on both sides), and one with 22 characters (plus *).  The 22 character code won't scan. 

JamesTedrick
Esri Esteemed Contributor

Hi Eddy,

I am able to do a test scan of a 22 character Code-39 barcode with Survey123.  What device are you using to scan?

EddyClark
Occasional Contributor

iPad Air 2 & iPhone X

EddyClark
Occasional Contributor

Code-39 Barcode

JamesTedrick
Esri Esteemed Contributor

Thanks for the sample.  I can replicate the failure to scan with the sample and another sample I generated based on the string pattern of your sample and have filed an issue to investigate.

JeffreyRamos
New Contributor

Hello. I couldn't to scan a white barcode with black background. I tried the different barcode types, no luck.

by Anonymous User
Not applicable

Hi Jeffrey,

Do you know what sort of barcode it is, the code type? Are you able to provide a copy/image of the barcode (scan or photo of it - best quality possible)? Also, what device and OS version are you using?

We have made quite a lot of improvements to barcode scanning in the upcoming 3.6 release, out of interest have you tested with the 3.6 RC builds available on EAC? There is a lot of improvements compared to 3.5 release when scanning barcodes on Android and 64-bit devices.

Phil.