How the Router Setup Property Works

The Router Setup property enables you to parse and push data from a Text Field, Text Area, File Upload, or Barcode Scanner question to target questions in your form. This topic provides an example of a Router Setup property configuration and describes how the Index and Regex options work.

Available on the Enterprise tier only:

Essentials
Advanced
Enterprise

Contents

Example of the Router Property configuration

The following example describes how you might configure the Router Property for a question that extracts substrings from a UDI barcode.

Your field technicians need to scan UDI barcodes for a variety of medical equipment. They will then carry out required maintenance based on the lot numbers and manufacturing dates.

  1. Add a Barcode Scanner question with the Router Setup property.

    Tip:For the Barcode Scanner question type, choose one or more standards to speed up barcode recognition:
    • UPC (A or E)
    • EAN (8 or 13)
    • Code 39
    • Code 128
    • QR Code
    • ITF

    The system recognizes all barcode types that the scanner can read, including UDI, regardless of which standards you select. Selecting a standard simply speeds up barcode recognition.

  2. Select the Regex option and add a regular expression to parse the barcode data.

  3. Select or add five supported target questions, and map a capture group to each question:

    • Device Identifier

    • Lot Number

    • Serial Number

    • Manufacturing Date

    • Expiration Date

  4. If you don't want your mobile device users to edit the target question values, configure the target questions as Read only.

  5. Save the Barcode Scanner question.

  6. After you save and deploy the form, your mobile users can scan or enter a barcode number and see the target questions automatically populated.

  7. In this example, you want the user to perform maintenance on equipment with specific lot numbers. Use Conditional Logic to set up a new rule that displays work instructions and questions based on the lot numbers.

How regex works

Note:Standard regex syntax applies.

  1. If your initial string is: a1b2c3-d4e-5f6g7

    the regular expression ^.+?-(.+?)-.+?$

    extracts the characters d4e.

  2. You'll typically extract more than one capture group. For example, for the string

    (01)12345678912345(11)123456(17)654321(10)891123(21)4321

    use the following regex to capture the full string plus five different groups:

    \(01\)([0-9]+)\(11\)([0-9]+)\(17\)([0-9]+)\(10\)([0-9]+)\(21\)([0-9]+)$

    or

    ^\(01\)(\d+)\(11\)(\d+)\(17\)(\d+)\(10\)(\d+)\(21\)(\d+)$

    to get the following results:

    Tip:

    If the string contains both numbers and letters, you can use the following expression:

    ^\(01\)(.+)\(11\)(.+)\(17\)(.+)\(10\)(.+)\(21\)(.+)$

  3. Then, you can map the capture groups to the questions in your form, as shown in the following example.

How index values work

If your initial string is: a1b2c3-d4e-5f6g7

the start and end index values 8 and 10

extract the characters d4e

Tip:A start index value with no end value extracts a single character.