# Dynamic Dataset creation for template repeater Vision

**URL:** <https://forum.inductiveautomation.com/t/dynamic-dataset-creation-for-template-repeater-vision/74800>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [June 8, 2023, 9:10pm UTC](https://forum.inductiveautomation.com/t/dynamic-dataset-creation-for-template-repeater-vision/74800 "2023-06-08T21:10:34Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [June 14, 2023, 3:55pm UTC](https://forum.inductiveautomation.com/t/dynamic-dataset-creation-for-template-repeater-vision/74800/6 "2023-06-14T15:55:59Z")

</div>

Now for a ~~working example~~ {Edit: `unionAll` changed, see below}, using the latest Simulation Aids:

> [@Automation Professionals' Integration Toolkit Module](https://forum.inductiveautomation.com/t/automation-professionals-simulation-aids-v2/74934/3):
>
> So I was poking around and realized I missed a major feature: a substitute for python's range() functions. And while at it, I factored out some common code so that where() and orderBy() could handle and return sequences instead of just datasets. Of the four iterators, now only the selectStart() function requires and returns a dataset. forEach() still only returns a list, but can accept datasets, lists, arrays, and single integers (for range behavior). Here ya go: For Ignition v8.1+ only: v…

As an expression function (use a reference to a `startid` tag instead of `50`):

```auto
unionAll(
	asList("Name", "Type", "ID"),
	asList("str", "str", "i"),
	forEach(
		15,
		"ValueA",
		"ValueB",
		50+it()
	)
)

```

Yields this dataset:

```auto
"#NAMES"
"Name","Type","ID"
"#TYPES"
"str","str","O"
"#ROWS","15"
"ValueA","ValueB","50"
"ValueA","ValueB","51"
"ValueA","ValueB","52"
"ValueA","ValueB","53"
"ValueA","ValueB","54"
"ValueA","ValueB","55"
"ValueA","ValueB","56"
"ValueA","ValueB","57"
"ValueA","ValueB","58"
"ValueA","ValueB","59"
"ValueA","ValueB","60"
"ValueA","ValueB","61"
"ValueA","ValueB","62"
"ValueA","ValueB","63"
"ValueA","ValueB","64"

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/dynamic-dataset-creation-for-template-repeater-vision/74800)._
