Description
Mobile can validate a step input by using Regular expressions
Use case
You can a step input to follow a specific pattern, e.g. prevent the user from typing certain characters
Example
We want to prevent special characters (&/*_) to be entered in the Lot Number step,
Only alfa-numeric values are to be allowed.
How to set it up
The change is made in the workflows section of Mobile Configuration Files.
Use "inputFormat" followed by a regular expression for what you want to achieve
Examples
- Match only alfa-numeric characters, blocking special characters
- ^\w+$
Validate date is in format DDMMYY where YY must be 20 or higher
(0[1-9]|[1-2][0-9]|3[0-1])(0[1-9]|1[0-2])(2[1-9]|3[0-2])
Use an online editor to test your regular expressions see Barcode converter - Regular Expressions
Workflow section
<workflow id="receiveWorkflow" itemNumberAI="01,02,91"> <configuration scanBehaviourWhenRegisteringQuantity="ScanNextItem" fastForwardMode="InputAndScanValues"> <steps> <...> <lotNumber id="32" inputFormat= "^\w+$" header="@{RegistrationCollectorLotNumberHeader}" defaultValue="{LotNumber}" helpLabel="@{RegistrationCollectorLotNumberHelpLabel}" eanAi="10"/> <...> </steps> </configuration> </workflow>
Result
If special characters are entered, an error stops the user.
See also
-
Validate inputFormat in workflow step — Mobile can validate a step input by using Regular expressions
-
Select, Add or Refresh Order Lines by Scan (LineSelection) — Select, Add or Refresh Lines by scanning
-
Select Line by scan (scanToSelectBehaviour) — Filter or Select Order Line based on a scanned value.
-
-
Register with Encoded Barcode (GS1) — Extract values from encoded into different steps
-
Barcode converter - Regular Expressions — The Mobile app can convert custom barcodes into the recommended Encoded Barcode (GS1)