# \[BUG\] tolist() broken in 8.0.5

**URL:** <https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454>\
**Category:** Ignition Early Access\
**Created:** [October 28, 2019, 4:22pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454 "2019-10-28T16:22:09Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmerrell](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dmerrell](https://forum.inductiveautomation.com/u/dmerrell)\
**Post date:** [October 28, 2019, 4:22pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/1 "2019-10-28T16:22:09Z")

</div>

Updated an existing project from 8.0.4 to 8.0.5. All my scripts that used .tolist() broke and gave error “object has no type .tolist()”. For example, grabbing the data from a table and using .tolist() on it. Reverted back to 8.0.4 and everything worked again.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 28, 2019, 4:25pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/2 "2019-10-28T16:25:42Z")

</div>

Can you give us an example of code that broke? What were you calling tolist() on?

---

<div class="post-metadata">

**Author:** ![dmerrell](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dmerrell](https://forum.inductiveautomation.com/u/dmerrell)\
**Post date:** [October 28, 2019, 4:44pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/3 "2019-10-28T16:44:30Z")

</div>

list = self.parent.parent.getChild(“Table”).props.data.tolist()

---

<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:** [October 28, 2019, 4:46pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/4 "2019-10-28T16:46:23Z")

</div>

The document ‘wrapper’ objects got updated - this is unintentional fallout from that change. Rather than calling `tolist()`, you can just use the builtin `list()` function: `list = list(self.parent.parent.getChild(“Table”).props.data)` - but, with the improved wrappers in 8.0.5, you hopefully shouldn’t actually need to do that - most features of the list class should be implemented by the wrapper objects already.

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [November 26, 2019, 4:38pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/5 "2019-11-26T16:38:21Z")

</div>

> [@paul-griffith](#):
>
> The document ‘wrapper’ objects got updated - this is unintentional fallout from that change. Rather than calling `tolist()` , you can just use the builtin `list()` function: `list = list(self.parent.parent.getChild(“Table”).props.data)` - but, with the improved wrappers in 8.0.5, you hopefully shouldn’t actually need to do that - most features of the list class should be implemented by the wrapper objects already.

On 8.0.6, I'm having issues using list() to get the Widgets list converted to a json string for the DB.

If I grab the item directly I get all the ArrayWrappers and ObjectWrappers. Doing a list() only seems to remove the ArrayWrapper but leaves the ObjectWrapper internally

Any ideas?

---

<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:** [November 26, 2019, 4:43pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/6 "2019-11-26T16:43:11Z")

</div>

Try this, in the meantime - I need to come up with a better way to handle conversion to json (or, our jsonEncode function needs to get better at encoding objects)

```auto
from com.inductiveautomation.ignition.common import TypeUtilities
jsonObject = TypeUtilities.pyToGson(<yourobject>)
print jsonObject

```

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [December 17, 2019, 11:13pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/7 "2019-12-17T23:13:56Z")

</div>

Not quite. Now it looks like this

> {"site":{"value":"chico","quality":{"code":192},"timestamp":"Dec 17, 2019, 3:07:32 PM"},"userId":{"value":1,"quality":{"code":192},"timestamp":"Dec 17, 2019, 3:07:32 PM"}}

When I want it to look like this

> {"site":"chico","userId":1}

It originally looked like this

> {site=[chico, Good, Tue Dec 17 15:12:41 PST 2019 (1576624361477)], userId=[1, Good, Tue Dec 17 15:12:41 PST 2019 (1576624361477)]}

---

<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:** [December 17, 2019, 11:27pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/8 "2019-12-17T23:27:54Z")

</div>

Can you share any more of what you’re doing/a code snippet? You shouldn’t really have to deal with qualified values much.

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [December 17, 2019, 11:40pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/9 "2019-12-17T23:40:32Z")

</div>

Sure. I simplified it for this post.

Here is the property on the view  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e111c79dc624982d137d7049c61b9ba1427e260b.png)

Change Script  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0950bfa02b77eb01802a85b760e45bce8914adae.png)

deserialize method from the StateMachine class  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/185b49abc4d54f9992f6f056f03e9da8cbd0e945.png)

---

<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:** [December 18, 2019, 12:09am UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/10 "2019-12-18T00:09:02Z")

</div>

So if you make your property change script `stateMachine = StateMachine.deserialize(TypeUtilities.pyToGson(currentValue.value))` you get the extra qualified value information?

You might just need to recurse down the qualified values yourself; at least in the short term.

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [December 18, 2019, 12:11am UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/11 "2019-12-18T00:11:22Z")

</div>

Okay. I have to ask why is it different between a component referencing the property value vs the value of the property coming through the change script?

---

<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:** [December 18, 2019, 4:44pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/12 "2019-12-18T16:44:41Z")

</div>

I’m not sure - I wasn’t party to the decision making back when the groundwork was first being laid for Perspective. It might just be a bug outright, although fixing it at this point risks backwards compatibility problems.

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [December 18, 2019, 5:51pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/13 "2019-12-18T17:51:38Z")

</div>

Here is the workaround solution that seems to work. I setup a second custom property I call “spy” that is bound to the first custom property. Then I setup my change script on the “spy” property that references my first property so that it will be in regular json and not qualified value json. This way I avoid using the currentValue parameter of the change script.

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [December 20, 2019, 5:44pm UTC](https://forum.inductiveautomation.com/t/bug-tolist-broken-in-8-0-5/29454/14 "2019-12-20T17:44:02Z")

</div>

Thanks for the responses on this thread.

I downloaded the AdHoc Trends screen from the Ignition Exchange. Most of it works but there are a few places where it’s using “tolist” which is not working in 8.05+.

One specific place is in “root.Contents.Chart.TabContainer.Pens”. There’s a script on that which handles the “delete” checkbox for pens. Line 8 of that script reads “pens = self.view.custom.pens.tolist()” which is currently broken in 8.05.

I changed “pens = self.view.custom.pens.tolist()” to "  
I changed the line to read “pens = list(view.custom.pens)” and the same on the next .tolist and it fixed it in 8.05 as suggested.

I assume it will break if I upgrade to 8.06. I typed this out so that anyone downloading that screen from Ignition Exchange knows how to fix it.
