Do until customer name change on Excel

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?

image

Thank you in advance!

@Jenny1
welcome to the forum

with
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

1 Like

Thanks @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?

@Jenny1

give me some little time and I will prepare a starter help for you

1 Like

@Jenny1
Find starter Help here with some sample data from a DataTable
GroupBy_DistinctFilter_Pattern.xaml (11.8 KB)

Thank you @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?
image

@Jenny1
Have a Look Here
AsEnumerable is not a member of 'System.Data.Datatable'

Thank you @ppr!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.