June 9, 2020, 1:06pm
Hello! I’m quite new with automation and I have problem. I have an excel file which includes customer name, product and price. Robot needs to insert orders to system based on that file. Problem is that one customer can buy several products and all rows which same customer name, need to be added to same order. How can I create loop which continues until the customer name change?
Thank you in advance!
June 9, 2020, 1:20pm
welcome to the forum
yourDataTableVar.AsEnumerable.Select(Function ( r ) r(“Customer name”).toString.Trim).Distinct().toArray
a String Array with unique customernames is created.
With a for each you can iterate over the Name Array, can use the name within a filter datatable activity and can do the processing per customer name
June 10, 2020, 9:20am
@ppr! Unfortunately I’m not that familiar with UiPath yet, so I don’t know how to use that in actions. Could you open that up a bit more, please?
June 10, 2020, 9:45am
give me some little time and I will prepare a starter help for you
June 10, 2020, 12:35pm
Find starter Help here with some sample data from a DataTable
GroupBy_DistinctFilter_Pattern.xaml (11.8 KB)
June 12, 2020, 7:51am
@ppr! Fixed this to work with my excel file without separately build datatable. Do you know what would be the problem that expression AsEnumerable don’t work on my own version?
June 12, 2020, 11:35am
June 15, 2020, 12:24pm
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.