BarcodeScannerInput not reading scan with Zebra Handheld terminal

Currently I have a Perspective View that has a BarcodeScannerInput with a defined regex that is:
P(.*?):

I can type in the designer, using the preview mode, the following string:
P12345:

The BarcodeScannerInput data field will populate with:
0:12345

When I use a Zebra MC930P to scan a barcode into the perspective view (using Chrome) nothing is added to the data field. Though, the data will appear as it did above if I type it with the hard keyboard on the Zebra MC930P in the same perspective view (using Chrome).

Also, when using a Zebra MC930P to scan a barcode the barcode will populate a text field when focused on, but the BarcodeScannerInput with not recognize it so the data is not output to the BarcodeScannerInput data field.

Does anyone know what I may be missing or not doing correctly?

It is not reliable to use the dot wildcard in such a regex. Probably shouldn't have the question mark there, either. Rewrite it to use proper character ranges that actually match your expected content.

I changed the regex to:
P([^:]+):

Still not able to get BarcodeScannerInput to read the scan in the Perspective View (using Chrome)

Hmm. Not obvious to me.

What is your barcode format? Looks like it always starts with P and always ends with :. Is there any format rules in-between those two characters?

If you just want what is between P and :, don't use regex, instead use them for your prefix and suffix as framing.

1 Like

Given that you can see the scanned data appear in a text field, I assume the data is indeed coming across in the correct format; that is, you have configured the barcode scanner with the correct prefix and suffix values? In the past, I've usually found this to be the problem.

As @dkhayes117 suggested, using the prefix and suffix values is definitely the way to go. However, as a quick test, to confirm that the barcode scanner component is receiving data, try setting your regex to (.+) and bind the data to a label. Might give you some insights.

@simeonw and @dkhayes117 Thank you for the suggestions.

My current scanner settings are not able to be changed. I ended up using a Text Field to send the data over an onChange Script and clearing the text field after 2 seconds.

By setting rejectUpdatesWhileFocused to false on the Text field, I was able to achieve the results I was looking for.