Looking Up A Data Source Row From a Barcode Scan

Looking Up A Data Source Row From a Barcode Scan

A common scenario that occurs in mobile business is the need to scan a barcode to look up information about the item to which the bar code is affixed. Effectively, one wants a Form that should capture the barcode and retrieve a row from Data Source. The way to do this is to use a Choices field along with a Data Source.

Scanning Barcodes Into a Choices Field
First of all, the Data Source needs to contain the various pieces of information for each barcoded item you expect to scan for. For example, let's call it the "Equipment" data source, where it might look something like:

BARCODE
EQUIPMENT NAME
CONTACT PERSON
LAST SERVICED
123456
Premier Chair
John Smith
10/28/2018
654321
Standard Table
Jane Doe
7/15/2009

The first column in your Data Source MUST contain the actual barcode values - i.e., the number or text that will be scanned in by the app. With retail barcodes, the numbers are usually printed under the barcode lines.

Now in your Form design, you would add a Choices field with:

  • Data name of, say, "equipmentChoice"
  • Data Source to be the "Equipment" one set up previously above
  • Tick the "Allow Barcode Lookup" option

Save your design and hit the TEST button to put the Form into Test mode for you to try out. Once in Test mode, every time you save changes to the Form design, you will be able to test these on the device without having to Publish each time.

Next, run the Form on your device, first wait for the "Sync Complete" message to confirm the new design has been downloaded. In the Form, you should notice that there is a Barcode button on the "equipmentChoice" Choices field. Hit the button and scan a barcode with the device camera. Assuming the code matches one of the rows in your Equipment data source, the app should display that row as selected.

Populating Other Fields Based on a Barcode Scan
In terms of populating other fields based on the row selected in your "equipmentChoice" field, this is done back in the Form designer.

  1. Go back to the designer and add a couple more fields below your "equipmentChoice" field. (ex. a Text field for the Equipment Name, another Text for Contact Name, and a Date Only field for the Last Serviced.) 
  2. Now on each of these fields, scroll down the list of properties on the right hand side until you see the "Bind To Data Source Column" option.
  3. On each field, choose the Equipment data source and then choose the relevant column to match the field.
  4. If you save your design and go back to the app, first make sure to force a synchronization to receive the design change. You can do this via "Check for Updates" button on the Settings screen of the app, or by simply putting the app into the background and bringing it back to the foreground via your device multi-tasking.
  5. Once you see the "Sync Complete" message, open up a new entry for your Form and repeat the steps to scan a barcode and get a selected row. This time you should see that once the row is selected in the "equipmentChoice" field, the other fields below are populated, too.


    • Related Articles

    • Barcode Field Type

      TABLE OF CONTENTS Basic Properties Data Name Title Text Hint Text On Scan Action Layout & Styling Field Layout Background Color Show Inline Validation & Behavior Required Visibility Dynamic Value Read Only Custom Validation Validation Message ...
    • Data Source Settings

      Basic, App Functionality, Advanced, and Connector options can be configured on the Data Source Settings page. Accessed by clicking on the Settings link when hovering over a data source on the Data Source page, or when viewing the rows of a data ...
    • Editing Data Source Rows

      User-Defined and Connected Data Sources can be edited in a variety of ways. You can edit directly in the web portal for small Data Sources or those that rarely need to be manually changed or edited. Click in a cell to edit/overwrite the data already ...
    • Referring to column values of a selected Data Source row

      The Form Designer allows you to link Choices fields to a Data Source that you have previously uploaded. Data Sources can have as many columns as you like, and you may want to refer to the values in these columns when creating a Form. To do so, you ...
    • SQL Server Data Source Connector

      After adding and authenticating an SQL Server Connection, you can add Form Connectors to push data to a database or pull data from a database using Data Source Connectors. Our platform lets you quickly and easily connect your data sources to a SQL ...