# Reading dataset and converting to PyDataSet

**URL:** <https://forum.inductiveautomation.com/t/reading-dataset-and-converting-to-pydataset/68009>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [December 27, 2022, 10:05pm UTC](https://forum.inductiveautomation.com/t/reading-dataset-and-converting-to-pydataset/68009 "2022-12-27T22:05:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![k-cottos](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@k-cottos](https://forum.inductiveautomation.com/u/k-cottos)\
**Post date:** [December 27, 2022, 10:05pm UTC](https://forum.inductiveautomation.com/t/reading-dataset-and-converting-to-pydataset/68009/1 "2022-12-27T22:05:20Z")

</div>

I'm having an issue converting a dataset tag. It looks like the readBlocking function is returning a list. Here's my code from the script console:

datasetIn = system.tag.readBlocking('_tagPath_')

datasetInPy = system.dataset.toPyDataSet(datasetIn)

The error I get is "TypeError: toPyDataSet(): 1st arg can't be coerced to com.inductiveautomation.ignition.common.Dataset"

Any thoughts on how I can convert a dataset tag to a PyDataSet?

---

<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:** [December 27, 2022, 10:41pm UTC](https://forum.inductiveautomation.com/t/reading-dataset-and-converting-to-pydataset/68009/2 "2022-12-27T22:41:18Z")

</div>

When you use readBlocking, you get a list of results, and those results are each a `QualifiedValue`, not your dataset type. Tack on `[0].value` to your first line.
