# Is Perspective BarCode Scan write the data to different global tags

**URL:** <https://forum.inductiveautomation.com/t/is-perspective-barcode-scan-write-the-data-to-different-global-tags/59577>\
**Category:** Ignition\
**Tags:** ignition81, scripting, perspective\
**Created:** [May 15, 2022, 1:58am UTC](https://forum.inductiveautomation.com/t/is-perspective-barcode-scan-write-the-data-to-different-global-tags/59577 "2022-05-15T01:58:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [May 15, 2022, 1:58am UTC](https://forum.inductiveautomation.com/t/is-perspective-barcode-scan-write-the-data-to-different-global-tags/59577/1 "2022-05-15T01:58:24Z")

</div>

I have design 3 views and all of them have the function use the camera to scan the barcode to read the data and need transfer the data to different tags

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/0/7013e8f1e72d5967c44558a6f8bd731c8bd4f991.png)  
but in the training video, if seems only can transfer to one decidate tag.  
My problem is , all the barcode infomation is very similar, so I can’t use tag’s data to check which infomation is base on which view.

So is that possible to realize the scaned data transfer to the tag based on the view?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 15, 2022, 12:16pm UTC](https://forum.inductiveautomation.com/t/is-perspective-barcode-scan-write-the-data-to-different-global-tags/59577/2 "2022-05-15T12:16:02Z")

</div>

Use a custom session property to maintain state. Write your view state (view name, perhaps) to that property just before you initiate the scan. Check the state property in the scan event to decide what to do.

---

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [May 15, 2022, 1:25pm UTC](https://forum.inductiveautomation.com/t/is-perspective-barcode-scan-write-the-data-to-different-global-tags/59577/6 "2022-05-15T13:25:56Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/c/4ce3ceb9aedccd20c96876b0f2070f45a8c031b2.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/d/cd5aeab1e127f7d523eb0c86eb8adba412929592.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/a/7a05acce68b7d8dc3d0850b9eadace486f35cdb5.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/e/5ec8fc1066d95c8f17291501a887c56a3ad8594d.png)  
I have try your suggestion like this, thanks a lot

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 16, 2022, 2:44pm UTC](https://forum.inductiveautomation.com/t/is-perspective-barcode-scan-write-the-data-to-different-global-tags/59577/7 "2022-05-16T14:44:33Z")

</div>

You can also decorate the ‘Scan Barcode’ action with context (any arbitrary, static key/value pairs):  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/0/40ea8f3c1f3e4c666887e7d318f9330c118520c5.png)

And then read that context in during the Barcode Scanned event:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/a/aa6d717aa5f7a0f5597b979c20fcb3d638695ba5.png)
