Loop & concadate data in a DataTable

Hello Community

Could you please help me with the following?

I would like to concatenate a string of values ​​if the company name is the same. As per below:

Current table

image

Expected
image

Any help you can give me will be greatly appreciated.

Thank you :slight_smile:

We can do a very clever solution using LINQ.

DT.AsEnumerable().GroupBy(Function(row) row("company_name").ToString())

See attached for full example.
DataTableGroupByExample.zip (28.4 KB)

Reference:

Hi @oddrationale,

Thanks for the help.

I am getting an error when trying to re-use your sequence. Do I need to install a package or import a component?


Thanks again. :slight_smile:

@jpespinosa

Check below post, we need to add a assembly reference to avoid that error

https://forum.uipath.com/t/tutorial-check-value-exists-in-excel-sheet-using-uipath-part-3-without-using-foreach-loop-filterdatatable/247533/3

Mark as solution if this helps you

Thanks

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