# \[Question\] session.props.device.barcode values

**URL:** <https://forum.inductiveautomation.com/t/question-session-props-device-barcode-values/21097>\
**Category:** Ignition Early Access\
**Created:** [November 27, 2018, 10:49pm UTC](https://forum.inductiveautomation.com/t/question-session-props-device-barcode-values/21097 "2018-11-27T22:49:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 27, 2018, 10:49pm UTC](https://forum.inductiveautomation.com/t/question-session-props-device-barcode-values/21097/1 "2018-11-27T22:49:41Z")

</div>

I am wanting to start fresh each time I do a barcode scan, but I am getting the last thing scanned, and then it changes when I scan again… I run the scan through a transform:  
with the property binding session.props.device.barcode  
if value is None or len(value) is 0:  
return ‘Nothing Scanned…’  
else:  
‘’‘session.custom.badge.write = value.data.text  
scanned = WhatWasScanned.props.text’’’  
return value[-1].data.text

If I run without the transform I get a whole list of what has been scanned. {“data”:{“text”:”24037”}}, {“data”:{“text”:”57517”}}, … …

How do/Can I re-initialize the array? I have already tried session.props.device.barcode = ‘’ to no avail…

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 27, 2018, 11:10pm UTC](https://forum.inductiveautomation.com/t/question-session-props-device-barcode-values/21097/2 "2018-11-27T23:10:25Z")

</div>

I have also tried (with no luck):  
data = session.props.device.barcodes  
system.dataset.clearDataset(data)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 28, 2018, 3:32pm UTC](https://forum.inductiveautomation.com/t/question-session-props-device-barcode-values/21097/3 "2018-11-28T15:32:26Z")

</div>

**Please note that barcode data has seen a substantial overhaul since this answer was provided.**

If you don’t need the barcode data kept, you could wipe the info with

```auto
self.session.props.device.barcodes = []

```

But again, this would wipe any previous scans.

The reason your second approach isn’t working is because you’re making a **new** object which has your data, in addition to the existing session.props.device.barcodes, and then you’re wiping/clearing the new object while the original is still safely in place.

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 28, 2018, 3:40pm UTC](https://forum.inductiveautomation.com/t/question-session-props-device-barcode-values/21097/4 "2018-11-28T15:40:47Z")

</div>

Awesome. Now if I could just get the morning beta download to move a little quicker… (30+ mins in so far…)
