Add new column

Hello Team,

DT contains 3 columns( unique Id, rate, action).
2 rows (row 1 - 111, 40, sale)
( row 2 - 111, 50, purchase)

If the columns (unique Id) matches then in new DT 2 new columns containing row 2 values must be added.

I.e New DT
unique Id, rate, action, new rate, new action
111 40 sale 50 purchase

Please guide with sample workflow.

Thanks

One of many options would be

Depending on some constraints another option could be a LINQ statement

There is not another datatable, only 1 dtattable, we need to create new datatable with added columns

@msalesforce777 Hi. Build datatable for DT2 with 5 columns. Then add the assign activity for DT2 with following statement on right. Hope this helps.
(From d In DT1.AsEnumerable
Group d By k=d(“Id”).toString.Trim Into grp=Group
Let rate = grp.Select(Function (rn) rn(“rate”).toString).toArray
Let action = grp.Select(Function (rn) rn(“action”).toString).toArray
Let row = New Object(){k, rate(0), action(0),If(rate.count>1,rate(1),“”),If(action.count>1,action(1),“”)}
Select DT2.Rows.Add(row)).CopyToDataTable

Hey @msalesforce777 ,
Try this workflow

Main.zip (2.4 KB)

Output:
image

Regards,

@msalesforce777 Please find the sample workflow attached. Hope this helps.
Datatabletest.zip (2.2 KB)