# Use Scan Barcode action to return data to specific instance of embedded view

**URL:** <https://forum.inductiveautomation.com/t/use-scan-barcode-action-to-return-data-to-specific-instance-of-embedded-view/84739>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [January 24, 2024, 9:56pm UTC](https://forum.inductiveautomation.com/t/use-scan-barcode-action-to-return-data-to-specific-instance-of-embedded-view/84739 "2024-01-24T21:56:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Wilson\_King](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@Wilson\_King](https://forum.inductiveautomation.com/u/Wilson_King)\
**Post date:** [January 24, 2024, 11:33pm UTC](https://forum.inductiveautomation.com/t/use-scan-barcode-action-to-return-data-to-specific-instance-of-embedded-view/84739/2 "2024-01-24T23:33:56Z")

</div>

I have found a workaround, from [this post by u/stevenson](https://forum.inductiveautomation.com/t/perspective-barcode-scan-context/51596/5). In my implementation, the view that needs data scanned into it from the session event first sets a session.custom property to the value of the return ID I wanted as context for the barcode scanner event, then the barcode scanner reads this session.custom property to provide the correct returnID in the payload of the barcodeScanned message.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0c1c5921b8f702dfaf0fba5da301c2f0797be981.png)

I think that the session custom variable is an inelegant solution, but the only one I can think of without a way to activate the session barcode scanner using a system method.

---

_[View the full topic](https://forum.inductiveautomation.com/t/use-scan-barcode-action-to-return-data-to-specific-instance-of-embedded-view/84739)._
