# How to concatenate rows in dataset in Ignition

**URL:** <https://forum.inductiveautomation.com/t/how-to-concatenate-rows-in-dataset-in-ignition/83358>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [December 20, 2023, 9:40am UTC](https://forum.inductiveautomation.com/t/how-to-concatenate-rows-in-dataset-in-ignition/83358 "2023-12-20T09:40:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anamay\_Belekar](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Anamay\_Belekar](https://forum.inductiveautomation.com/u/Anamay_Belekar)\
**Post date:** [December 20, 2023, 9:40am UTC](https://forum.inductiveautomation.com/t/how-to-concatenate-rows-in-dataset-in-ignition/83358/1 "2023-12-20T09:40:30Z")

</div>

I want to concatenate rows in a dataset. I came across same thing but it is for concatenating column - groupConcat. But I want to do it for rows.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [December 20, 2023, 10:34am UTC](https://forum.inductiveautomation.com/t/how-to-concatenate-rows-in-dataset-in-ignition/83358/2 "2023-12-20T10:34:22Z")

</div>

You'll need to be a bit more descriptive about what you want to do.  
I suggest giving an example: a sample input and a sample output always help to visualize what the goal is.

---

<div class="post-metadata">

**Author:** ![Anamay\_Belekar](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Anamay\_Belekar](https://forum.inductiveautomation.com/u/Anamay_Belekar)\
**Post date:** [December 20, 2023, 11:09am UTC](https://forum.inductiveautomation.com/t/how-to-concatenate-rows-in-dataset-in-ignition/83358/3 "2023-12-20T11:09:33Z")

</div>

Ok, so I have a button, I have created a custom property - PATH\_TAG

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/9/79935a1c3daf515d6953dfa7f9890b3353ea70cc.png)

And I want to merge the 3 columns PRE, VAL, POST in a single column so that the resultant column will give me the concatenated path.

So after merge, the column should be like

[default]PROJ/OPC/EI-101BB/Value.value  
[default]PROJ/OPC/EI-102BB/Value.value  
[default]PROJ/OPC/EI-103BB/Value.value  
[default]PROJ/OPC/EI-104BB/Value.value

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [December 20, 2023, 12:12pm UTC](https://forum.inductiveautomation.com/t/how-to-concatenate-rows-in-dataset-in-ignition/83358/4 "2023-12-20T12:12:03Z")

</div>

So you DO want to group columns and not rows, unlike you said in the first post ?  
I don't think you can do that with an expression, at least not the built-in ones.  
If you can install @pturmel 's integration toolkit module, you'll probably find a way to do what you want with an expression.  
If you can't, you'll have to use a script.

I'll give you an example later, I can't do that now.

---

<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 20, 2023, 12:12pm UTC](https://forum.inductiveautomation.com/t/how-to-concatenate-rows-in-dataset-in-ignition/83358/5 "2023-12-20T12:12:35Z")

</div>

If you **don't** want to do this in your database (where you can use is string concatenation), you will certainly want to use my Integration Toolkit's iteration functions. Your example would look like this:

```auto
unionAll(
	asMap('combinedPath', 'str'),
	forEach(
		{Root Container.path.to.PATH_TAG},
		asList(
			concat(it()['PRE'], it()['VAL'], it()['POST'])
		)
	)
)

```
