Perspective Barcode Scan context

I’m trying to figure an effective way of handling multiple barcode scan events.

I have an embedded view containing a text field + button. What I want to happen is the button is pressed, the camera reads the barcode and the text field displays the scanned barcode.

If there is only 1 instance of that embedded view, I can return the value via message handler or in a custom session property, then bind the text field there.

However if I’m placing the embedded view in a flex repeater, how would I go about getting the barcode value sent to the correct text field? I do have a unique identifier as a parameter on the embedded view, but I can’t bind the barcode scan context property to that id.
Similar to this:

Any ideas would be appreciated!

Never mind found a work around.

Double up the script event of the button to save the identifier in session.custom in a script, then the scan barcode.
Then from there when the barcode scanned session event is fired, you can read back the above and pair the barcode value with the identifier.

Thanks for sharing your solution @stevenson :slightly_smiling_face:
Exactly what I searched the forum for. Works like a charm! :ok_hand:t3:

Stevenson, do you mind sharing screenshots of what you did? I’m confused from your solution.

Here’s my button for a barcode scan:
First script:


Scan barcode:
image

Session Handler:

“Barcode1” can be replaced with any unique identifier to handle multiple scan events and fields.
From there the text field showing the scan value can just be bound to session.custom.Barcode.Scanned[<identifier>]

Hope this helps!

3 Likes

you’re amazing, thank you so much! Just a quick question. Would this way of setting up the barcodes allow me to connect specific barcodes to specific tags?

I don’t see why not. You could have a change event script on the session.custom.Barcode object that would write the newly scanned barcode to a tag.

Thank you again, I really appreciate it!