# Dataset not converting

**URL:** <https://forum.inductiveautomation.com/t/dataset-not-converting/76885>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [July 25, 2023, 4:58pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885 "2023-07-25T16:58:10Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 25, 2023, 4:58pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/1 "2023-07-25T16:58:10Z")

</div>

copy/pasted from another working project, but i don't see why this isn't working:

```python
	userDataset = system.tag.readBlocking(userDataPath) # <--- '[]/Users/username
	system.perspective.print(userDataset) # <--- this prints
	py_userDataset = system.dataset.toPyDataSet(userDataset) # <--- dies here
	system.perspective.print('bloop') # <--- this does not
	system.perspective.print(py_userDataset) # <--- nor does this
    # ... additional code that follows, but never executes because of line 3

```

this is the stuff that kneecaps me right when i think i'm getting a stride going...

---

<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:** [July 25, 2023, 4:58pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/2 "2023-07-25T16:58:59Z")

</div>

Where is this executing? What is the error?

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 25, 2023, 5:04pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/3 "2023-07-25T17:04:25Z")

</div>

it's in a called function from the project script library. it all works just fine up until that one line. then it dies. and since i have not yet had time to implement a logging system, this is the interim tracking solution. (which sux, i know, but i only have so many hours in a day.) as for what error, have no idea. it normally works in other scripts of similar scope, so i'm stumped. and `userDataset` populates properly, which was my biggest concern, so i can't understand why the conversion tanks since it's just processing variable data... 😕

---

<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:** [July 25, 2023, 5:05pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/4 "2023-07-25T17:05:08Z")

</div>

I told you this in another thread - you don’t need to implement your own logging system. When a script fails to execute an error should be logged in the Ignition Gateway logs.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 25, 2023, 5:10pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/5 "2023-07-25T17:10:16Z")

</div>

Does `userDataPath` point to a Dataset Tag?

Even so, with this code, `userDataset` would be a list of _QualifiedValue_ objects not a _Dataset_.

Change the first three lines to:

```auto
userDataset = system.tag.readBlocking(userDataPath)[0]
system.perspective.print(type(userDataset.value))
py_userDataset = system.dataset.toPyDataSet(userDataset.value)

```

See what type prints out then

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 25, 2023, 5:11pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/6 "2023-07-25T17:11:28Z")

</div>

i know that. but i don't want to dig through 1000s of lines of every 🍴 system's dump to logs. literally **every** client's system dumps there. plus, i have no idea what i'm looking for. 😛

but you have a point: stop being a lazy 🐩 and dig. \*_sigh\*_ be right back...

---

<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:** [July 25, 2023, 5:11pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/7 "2023-07-25T17:11:46Z")

</div>

Yes, I spotted this as well, but he needs to learn how to troubleshoot for himself, and avoiding the logs like a scared child isn't going cut it.

edit: sorry, a bit harsh on my part. I was maybe a bit hangry 😛

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [July 25, 2023, 5:33pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/8 "2023-07-25T17:33:01Z")

</div>

> [@ian.sebryk](#):
>
> dig through 1000s of lines

You can filter the logs to only match certain projects, views, etc:  
[https://docs.inductiveautomation.com/display/DOC81/Diagnostics+-+Logs#DiagnosticsLogs-MappedDiagnosticContextKeys](https://docs.inductiveautomation.com/display/DOC81/Diagnostics+-+Logs#DiagnosticsLogs-MappedDiagnosticContextKeys)

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 25, 2023, 5:59pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/9 "2023-07-25T17:59:05Z")

</div>

@Kevin.Herron i beg your pardon?? you neither know me nor what i'm working with nor my time pressure. i'll thank you to refrain from responding in the future if this is the kind of 'help' you're offering. 'scared child' indeed... 🙄 i even ceded the point... good Lord...

@lrose yes, it points to a valid tag. but i keep forgetting that bloody index... and i looked up `QualifiedValue` and now understand better. thank you. working code looks like this:

```python
userDataset = system.tag.readBlocking(userDataPath)[0].value
# blah blah blah.

```

there is so much Java spillover that i think i need to just learn some basic Java to understand this 💩. there's nothing like this in Python and it's always throwing me for a loop.

---

<div class="post-metadata">

**Author:** ![Tim\_Carlton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_carlton/32/52835_2.png) [@Tim\_Carlton](https://forum.inductiveautomation.com/u/Tim_Carlton)\
**Post date:** [July 25, 2023, 6:19pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/10 "2023-07-25T18:19:05Z")

</div>

BTW, readBlocking takes a list of strings, not a string.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 25, 2023, 6:20pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/11 "2023-07-25T18:20:28Z")

</div>

> [@ian.sebryk](#):
>
> there is so much Java spillover that i think i need to just learn some basic Java

Ever wrote C#? Basically Java.

Either way, if you have a list of python objects with publicly accessible variables you would call them the same way.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 25, 2023, 6:42pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/12 "2023-07-25T18:42:59Z")

</div>

> [@Tim\_Carlton](#):
>
> BTW, readBlocking takes a list of strings, not a string.

True, but there is a special case where it will take a single string and work.

It is essentially a way to ease compatibility from the old `system.tag.read()` function that did take a string

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 25, 2023, 8:57pm UTC](https://forum.inductiveautomation.com/t/dataset-not-converting/76885/13 "2023-07-25T20:57:07Z")

</div>

> [@Tim\_Carlton](#):
>
> readBlocking takes a list of strings, not a string

Wrong, it takes both. The doco I believe still says it takes only a list, and that's what you _should_ give it, but the function was modified ages ago to accept just a string as well. Albeit, it always returns a list

Oops, I missed @lrose 's reply 😅
