Conditions are useful when the software where you need to put data requires to perform a sequence of actions only when a condition is verified.
The components required to make it happen are the and the component. Their job is to change the flow of execution of the Output template.
Let’s say that you need to put the barcodes that do not start with “9” into another column:
In that case the output template would like something like this:
- The first component acquires the barcode and stores its value in the global variable called “barcode”.
The checkbox is unchecked because we want to skip the output of this component.
- The IF component will perform the check over the “barcode” variable.
- If the condition is true, it’ll allow the flow of execution to continue with the next component that will acquire the second barcode.
- But if the condition is false, it’ll cause the flow of execution to skip to ENDIF component, from which point execution will proceed.
Tip: If you want to add a delay between the acquisitions you can do that by increasing the “Timeout” option from the app settings.
To edit the component, you simply need to click over it:
The IF component is evaluated on the app side when a scan is performed, more in particular when the app is populating Output template.
More condition examples
quantity == 1
timestamp > new Date().getTime() * 1000
device_name == "John's iPhone"