I have a file with 24 columns of data of which I want to concatenate 3 of them into a new column, how can I do this?
@alexis.mendoza.rpa can you explain little detaily do you want column1+column2+column3 in differnt column like these?
Hi @alexis.mendoza.rpa ,
Add a new column and loop through each row in your DataTable using a For Each Row activity. Concatenate the three columns you want and store the result in the new column
Example:
row(“NewColumn”) = row(“Col1”).ToString + " " + row(“Col2”).ToString + " " + row(“Col3”).ToString
I hope this helps. Cheers!!
Could you show me how to do it?
And if there’s a faster way to do it, I should do it with more than 20,000 records.
Hi,
In my opinion fastest way would be to use modern excel activities, it’ll reduce the time of reading data into data table. All you have to do is use write cell activity and write an excel formula as a string “=A2+B2+C2”, select the range using select range activity ofc (Upto where you want to apply this formula, you can find the row index of last filled value to make it dynamic) and send hotkey key “ctrl+D”, you’re good to go. Cell indexes will be automatically updated using this method. I hope this helps. Cheers!!
can you show me how do it?
@alexis.mendoza.rpa here is a shortest way using Linq i have attached the flow for reference
(From row In dt_data.AsEnumerable()
Let concat = row(“Name”).ToString.Trim & row(“Age”).ToString.Trim & row(“ID”).ToString.Trim
Select outputTable.LoadDataRow(row.ItemArray.Take(3).Concat({concat}).ToArray(), False)).CopyToDataTable()
BlankLibrary.zip (3.2 KB)
hi,
There you go, I hope it helps.
Dummy.zip (2.5 KB)
Hello @alexis.mendoza.rpa
You could:
- Use a Create Data Column activity to create the new column for storing the data
- Then a For Each Row in Data Table to iterate the rows
- And then an Assign to join the data from the other columns
Assign CurrentDataRow("new column") = CurrentDataRow("column1")+CurrentDataRow("column2")+CurrentDataRow("column3")
Regards
Soren
- Build clone of original datatable
- Use for each row in datatable and use assign activity and join all the values of required columns using '+ ’ operator.
- Now build datable or use add column.
- You can check Merge/join activities too.
It works fine, how can I add a space between the data?

@alexis.mendoza.rpa Try these
(From row In dt_data.AsEnumerable()
Let concat = row(“Name”).ToString.Trim & " " & row(“Age”).ToString.Trim & " " & row(“ID”).ToString.Trim
Select outputTable.LoadDataRow(row.ItemArray.Take(3).Concat({concat}).ToArray(), False)).CopyToDataTable()
@alexis.mendoza.rpa is it working?
have a look at the Blog and refer to the option by using the column expression approach
use add data column to add new column
then use assign with following which will concatenate all rows
dt.Columns("NewCol").Expression = "[Col1]+[Col2]+[Col3]"
cheers
@alexis.mendoza.rpa can you copy paste the code you have written and screen shot of you flow
it working god thanks
@alexis.mendoza.rpa Great to hear! Kindly mark it as the accepted solution. ![]()

