How to concate the string of rows with same id in datatable uipath?

HI All,
I have a following data table .


Id name
1 ranjith
1 kumar
2 balaji
2 raj
2 kalyan

I need to covert below format.


Id name
1 ranjith,kumar
2 balaji,raj,kalyan
please try to help me on this.

@Ranjith1996 Try below workflow.

new.xaml (12.7 KB)

1 Like


Try like this,
Let us take you are having datatable as dta

dtOutPut= (From p In dta.Select
                 Group p By ID= Convert.ToString(p("Id")) Into GroupA=Group
                 Select dta.Rows.Add(GroupA(0)("Id").ToString,string.Join(",",(From p In GroupA Select Convert.ToString(GroupA("name"))).ToList))).ToArray.CopyToDataTable

I have not tested the code, If any validation errors, please let me know.


1 Like

Thanks you guys

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.