Avoid overwrite of excel

Greetings of the day…!!!
I am writing the mail id and date of the sender from outlook to an excel sheet and adding status as success or failure to check for an attachment present. I am using build data table activity to create a table and add data row activity is used to add the mail id and date of the sender, Write range activity is used to write the data in excel and output data table is also created. Now I am facing the problem of overwriting. I have three key skill in excel such as java developer,rpa developer, and associate software. so the code checks for each keyword in the subject line and downloads the attachment. while I am trying to write the data about the downloading file in an excel only the last key skill that associate software is alone getting written on the excel. how can I write all the details about the attachment in an excel.
Please help me with this case…

Thank you
Soumiya

Hi @soumi_soumiya
Try to use Append Range instead of Write Range.

Thanks for your reply…if i am using append range i am getting the all the mail id and date that are in mail i need only the mail that has attachment that matches with my keyword

For that you can use filter according to your condition

but how

@soumi_soumiya

  • Use following steps
  • Read Emails using get outlook mail messages.
  • Use if condition and and give the condition as “Item.Attachments.Any”
  • It will check if any attachment is present or not in Your mail.
  • In the then section use use “CType(item.Attachments.FirstOrDefault, Attachment).Name” And store it in Variable suppose as AttachmentName
  • It will give you attachment name.-Then use another if Condition inside the then section adn use the condition as AttachmentName.contains(“YourRequiredContains”)
  • In then then section Use add data row activity.
  • After that Use Append range Activity to append the data.
    I hope this will help you
    Thanks & Regards
1 Like

Hi @soumi_soumiya,
Can you please share your workflow or screenshot of the same so that, your problem is properly understandable? If possible please share the screenshot of the excel sheet also.

Thanks & Regards,
Apurba

1 Like

Thanks for your reply…
I am attaching my workflow.
Main.xaml (28.7 KB)
input excel
book1234.xlsx (7.8 KB)

Hi @soumi_soumiya,
Are you trying to process mail with certain ‘subject’ line, save the attachments, if attachments found then have to write ‘Success’ otherwise ‘Failure’ in the excel sheet along with sender’s ID and date?

Thanks & Regards,
Apurba

1 Like

yes your right

Thanks
Soumiya

@soumi_soumiya
Find attached workflow it will help you. use your credentials in Get outlook mail messages.Email_Test.zip (639.6 KB)

1 Like

Hi @soumi_soumiya,
As all the resources are not available to me, like your mails with mentioned ‘subject’ line, I have tried with my resources. Please have a look the file provided below -
Forum(soumi_soumiya).zip (24.8 KB)
Please change the ‘subject’ line and all like that as your requirement.

Thanks & Regards,
Apurba

1 Like

Thank you it works good

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