Scannable If

It would be nice if we could not just enable scanning, but also control it with an expression.

Let’s say, products of Category1 do have a barcode, but Products of Category2 do not have.

So in the form I first have to choose the Category.
After that I have to enter the Item Number. Via Barcode scan or via the keyboard.

We could use an expression like this in the Scan function:

IF([Category] = "Category1" , true , false)