How to select repeated row based on specific column in csv and copy them with headers to another excel or csv file

Hi, I am very new to UI path. I need help to select repeated row based on two specific column, “User Name” repeated and “Outstanding bill duration >3” in csv file and copy them with the row header in another file. Each user will get a excel file with their repeated rows via outlook email. How can this be done. Thank yououtstandin123.xlsx|attachment (9.6 KB)

1 Like

Hi @Bee1

The excel and the other attachment you shared cannot be opened. Could you re share it so we can have a look to get a better understanding on your question…

Fine
—hope these steps could help you resolve this
—use a get outlook mail activity and get the output variable of type list of mail messages named list_mailmessage
—now use a for each loop activity and pass the above variable a string input and change the type argument as system.net.mail.mailmessage
—inside the loop use a save attachment activity and mention the mailmessage property value as item and mention the folder path where we want to save the file
—now the file will get saved in that folder
—now use a assign activity and mention like this
out_filepath = Directory.GetFiles(“yourfolderpath”,”*.xlsx”).orderbydescending(Function(d) new fileinfo(d).Creationtime).ToList(0)
Where out_filepath is a string variable

—use a excel application scope and pass the input as out_filepath
—inside the loop use a read range and get the output with a variable of type datatable named outdt
—now use a assign activity and mention like this
outdt = outdt.Select(“[Outstanding bill duration] > ‘3’ “).ColyToDatatable()

Now this outdt will be having the record we want which can be written to a excel file with Write range activity by mentioning the datatble name, sheet name

Cheers @Bee1

Hi, Lahiru

Here is the file.
outstandin123.xlsx (9.6 KB)

Thanks, Palaniyappan. As I am not familiar with UIPath, possible that you provide xaml file of above steps so that I can study and understand. Here is the sample data file. Thanking you in advance. outstandin123.xlsx (9.6 KB)