I’m looking for a one-liner of code in an Assign activity vs using a loop structure.
Simple schema of my data table. This is not all columns but the related ones to this question.
(And yes, this data table is destined for a queue set to Unique in Orchestrator).
My OrderID column will have values of like so: 11111111
What I need is the following done to the OrderID value for each row copied to the Reference field for that row with the following format:
I have a loop and an assign activity that basically does this:
row.Item(“Reference”) = row.Item(“OrderID”).ToString+"="+Guid.NewGuid().ToString
(And, yes, I know the Reference column of an Orchestrator queue should already be unique … just bare with me)
This works fine but for a large number of rows it adds up. As such, I’m looking to see if there is a one liner that could do the same thing but MUCH faster. By a one-liner I mean something similar in concept to this:
dt_OrderLinesFiltered = dt_OrderLinesFiltered.AsEnumerable.Where(Function(r) If(IsDate(r(“Start Date”).ToString.Trim),Convert.ToDateTime( r(“Start Date”).ToString.Trim ) > date_dateToleranceBack,False) ).CopyToDataTable
I found a reference to the AsEnumerable example on some web forum and hacked (hacked as in my programming ability) into UiPath and it works VERY quickly to filter out all rows whose “Start Date” value is greater than a computed earlier date value.
Hoping someone can let me know if there is a one-liner to do the loop-over-all-and-copy-a-with-value-formatting example that is faster than using a loop-with-assign approach.