# Nested Datasets, or arrays within a dataset

**URL:** <https://forum.inductiveautomation.com/t/nested-datasets-or-arrays-within-a-dataset/63791>\
**Category:** Ignition\
**Tags:** scripting, ignition81\
**Created:** [September 6, 2022, 7:19pm UTC](https://forum.inductiveautomation.com/t/nested-datasets-or-arrays-within-a-dataset/63791 "2022-09-06T19:19:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [September 6, 2022, 7:19pm UTC](https://forum.inductiveautomation.com/t/nested-datasets-or-arrays-within-a-dataset/63791/1 "2022-09-06T19:19:31Z")

</div>

Hi guys,  
I was wondering about the level of support there is for nesting datasets, or at least putting arrays in a column of a dataset. It seems doable based on my limited testing in the script console in Ignition 8.1.17, but I worry if I start doing that in a few places, will I be doing something I shouldn’t?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 6, 2022, 7:31pm UTC](https://forum.inductiveautomation.com/t/nested-datasets-or-arrays-within-a-dataset/63791/2 "2022-09-06T19:31:59Z")

</div>

I don’t believe a dataset can have a column of type dataset.

But if you need to keep a collection of items together, why not a dictionary? You can nest dictionaries as deep as you want.

```auto
d = {"ds": firstDataset,
        "array":[1,2,3,..],
         "children": [
               {"ds":anotherDataset, "array":[4,5,6,...], "children":[]},
               {"ds":thirdDataset, "array":[6,7,8,..],"children":[# could add even more here]
                              ]
      }

```

If you explain exactly what your problem is and what you’re trying to accomplish people here will be able to offer better suggestions.

---

<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:** [September 6, 2022, 7:35pm UTC](https://forum.inductiveautomation.com/t/nested-datasets-or-arrays-within-a-dataset/63791/3 "2022-09-06T19:35:53Z")

</div>

> [@gdube](#):
>
> ...doing something I shouldn’t?

Yup. Datasets themselves tolerate anything at all if you declare the column type as `Object` (which you can do with the DatasetBuilder class quite easily). Try to stuff them in a dataset tag and it'll blow up on you (very limited allowed types). Or try to put them in a message payload and it'll blow up on you (must be serializable).
