I'm having some trouble using the Scan Barcode action in a way that allows the data from the most recent scan to populate into the view that called the scan. My idea was to use the Context section of the Scan Barcode action to pass a parameter from the instance of the view calling for the scan into the context of the scan. Now the session event script that triggers after the barcode will have an identifier for the component that called the scan. This would allow me to send a message of the type "barcodeScanned" from the session event script, with a return identifier supplied in the payload of the message that each instance of the embedded view could check against their own identifier. The Barcode Data handling script for this implementation would look like this:
The problem is, there doesn't seem to be a way to supply anything other than a constant value for the context of a scan when configuring the Scan Barcode action.
I cannot reference the properties of the component doing the action, and I cannot call the Scan Barcode action using a script the way I can with other actions in the system.perspective path. This results in no way to differentiate between instances of the view that initiated the action, as far as I can tell.
Is there a way to pass the data from a Barcode scan session event to the specific instance of the view that triggered it?