I can not use the UiPath for each activity because I have to much data for a reasonable run time. I have been tiring to use LINQ like this
(From d In DT_Elevated.asEnumerable()
If (not(string.IsNullorEmpty(d(0))),Let Section = d(0) )
Let ra = d.ItemArray
Let ra(0) = Section
Select DT_sig.Rows.Add(ra)).CopyToDataTable
dt = dt.AsEnumerable.Select(Function(r,i) dt.Clone.LoadDataRow({dt.AsEnumerable.Where(Function(r2,i2) i2<=i andAlso not String.IsNullOrEmpty(r2(0).ToString)).Last.Item(0).Tostring,r(1)},False)).Where(Function(r) not String.IsNullOrEmpty(r(1).ToString)).CopyToDataTable()
Maybe you could try with a For Each Row Activity as it is performing a Simple Update with an If Condition Activity. The Implementation would be something in the below manner, assuming that the first column first value will not be empty.
We also apply Filter Datatable Activity to remove the rows which have the data1 column values empty.
Visuals :
Input :
Output :
Let us know if the For Each Row does take a longer time or it doesn’t get the output in the expected manner.