Save unread mail attachments and read those one by one

Hi Everyone,

can someone help me in my project, i trying to save all unread attachments from outlook and wants to use those excel attachments to read one by one for web scrapping.

like i have mail attachments & i am saving those in a folder now i want to take data from that excel files one by one to complete and fill form one by one.

Thanks, please help me in this process flow.

Hi @Dhananjay_lavate

Welcome to uipath community
I hope there is no functionality to check with the unread attachments rather we can check with the unread mails, which is inturn implies the same with unread attachments
–For that use get Outlook mail activity and check the onlyunreadmessage property in the get outlook mail activity that would make sure that we read only onlyunreadmessage and also check the property markasread as well
–get the output from this activity with a variable of name out_message of type list of mailmessages
–then use a for each loop and pass the above variable as input and change the property of the for each loop with Type argument as system.Net.Mail.Mailmessage
–inside the for each loop use a save attachment activity and mention the mail as item the variable that we obtain from the for each loop and mention the folder where we want to save the attachment
–then next to this for each loop use a assign activity like this
Out_Filepatharray = Directory.GetFile(“yourfolderpath”,"*.xlsx")
this will give us all the excel files in that folder with which we can read one by one
and out_filepatharray is a variable of type string array
–use a for each loop and pass the above variable as input and change the type argument as string
–inside this use a excel application and mention the file path as item
–use a read range activity within this scope and get the output as a variable of type datatable named out_dt
–then use open applicaiton (if desktop application) or open browser (if web form) and use type into activity with input like row(“yourcolumnname”).ToString to input the forms with the excel value

Thats all buddy you are done
Hope this would help you
Cheers @Dhananjay_lavate

Thanks @Palaniyappan,

Do you have any example with main.xml? please share if you have.

@Palaniyappan,after complete this,i will schedule this on orchester for particular time period, so however i will get new mails with new attachments it should take those new attachments and should fill web form, this is the functionality should work , do we have solution for this?
Please suggest.

Read outlook emails
Saves email attachment to particular folder
Get downloaded XLS files and open it.

Above workflow OutlookAttachmentDownloadAndAccessXLS.xaml (8.6 KB) is implemented here.
After opening xls files, you need to add what manipulations you need to do further as per requirement.

TO read range from excel downloaded, use this OutlookAttachmentDownloadReadXLS.xaml (7.6 KB)

1 Like

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