# Import or copy 3 arrays into one dataset

**URL:** <https://forum.inductiveautomation.com/t/import-or-copy-3-arrays-into-one-dataset/41340>\
**Category:** Ignition\
**Created:** [December 9, 2020, 3:57pm UTC](https://forum.inductiveautomation.com/t/import-or-copy-3-arrays-into-one-dataset/41340 "2020-12-09T15:57:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![darren.sisco](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@darren.sisco](https://forum.inductiveautomation.com/u/darren.sisco)\
**Post date:** [December 9, 2020, 3:57pm UTC](https://forum.inductiveautomation.com/t/import-or-copy-3-arrays-into-one-dataset/41340/1 "2020-12-09T15:57:29Z")

</div>

Hello, I have 3 array tags that I would like to compile into one dataset. They are all an array of 32. The first array is a Boolean (true, false), the other two are strings. Is this possible? I can only find examples of created arrays from datasets and dataset manipulation. Thanks

---

<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 9, 2020, 5:31pm UTC](https://forum.inductiveautomation.com/t/import-or-copy-3-arrays-into-one-dataset/41340/2 "2020-12-09T17:31:07Z")

</div>

You want each array to be its own column in the dataset? Absolutely possible. You’ll want to use the [`system.dataset.toDataset()`](https://docs.inductiveautomation.com/display/DOC81/system.dataset.toDataSet) function - something like this might work directly, though I’ll admit it’s untested:

```auto
tags = [
	"path/to/boolArray",
	"path/to/stringArray1",
	"path/to/stringArray2"
]

values = system.tag.readBlocking(tags)

headers = ["booleanArray", "stringArray1", "stringArray2"]

dataset = system.dataset.toDataset(headers, values)

```

---

<div class="post-metadata">

**Author:** ![darren.sisco](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@darren.sisco](https://forum.inductiveautomation.com/u/darren.sisco)\
**Post date:** [December 9, 2020, 6:07pm UTC](https://forum.inductiveautomation.com/t/import-or-copy-3-arrays-into-one-dataset/41340/3 "2020-12-09T18:07:29Z")

</div>

Hello, I should have mentioned I’m on 7.9.12.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 9, 2020, 6:28pm UTC](https://forum.inductiveautomation.com/t/import-or-copy-3-arrays-into-one-dataset/41340/4 "2020-12-09T18:28:23Z")

</div>

7.9 will use readAll() instead of readBlocking. You’ll also need something to convert the data to a tall format.

```python
tags = ["path/to/boolArray",
	    "path/to/stringArray1",
	    "path/to/stringArray2"
	   ]
	   
values = [list(tag.value) for tag in system.tag.readAll(tags)]

headers = ['bool', 'string1', 'string2']

# Convert from wide to tall
data =[row for row in zip(*values)]

dataset = system.dataset.toDataSet(headers, data)

```

---

<div class="post-metadata">

**Author:** ![darren.sisco](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@darren.sisco](https://forum.inductiveautomation.com/u/darren.sisco)\
**Post date:** [December 9, 2020, 9:54pm UTC](https://forum.inductiveautomation.com/t/import-or-copy-3-arrays-into-one-dataset/41340/5 "2020-12-09T21:54:12Z")

</div>

I ended up with this:

I created a table. I passed in 3 parameters to a custom method. I applied the below script to a table. I made an expression on the [data] part of the table as runScript(buildDataset,0)

```
headers = ['value','address','description']
data = []
for i in range(len(inputs)):
	row = [inputs[i],addresses[i],desc[i]]
	data.append(row)
return system.dataset.toDataSet(headers,data)

```

Thanks, Darren
