This article guides you through matching a multifield barcode that contains different parts of information with details of the product. In this example, we match the first number of a barcode to the job information.
Take this example, there are 2 barcodes; 12345 or 23456 and each digit of the first number matches a Site ID.
- If the first digit is a 1, the site ID is ABC
- If the first digit is a 2, the Site ID is XYZ.
Here are the steps to creating the validations:
Step 1 - Create two fields in a form; 'Barcode' and 'ID'.
- The barcode digit will be scanned into this field by a user.
- The ID will be pulled automatically from the product list
Step 2 - In the ID field, you can automatically pull data from the product list using the variable icon:
Step 3 - In the 'ID' validation rules tab, create the following validations:
-
(data["Barcode"]=~"^1")&&(data["ID"]=="ABC")
NOTE: the "^1" is referencing the first digit and it must be a 1.
-
(data["Barcode"]=~"^2")&&(data["ID"]=="XYZ")
NOTE: the "^2" is referencing the first digit and it must be a 2.
-
1==1
When creating an invalid field, we use the expression '1==1' to include everything outside of the valid range.