Outlook/Web Folder Check

Requirement - I need fetch all Emails from Inbox folder and check that if subject consists of RW/FW then i need to check that particular email in Completed folder. If present no operation if not present then i need to perform certain actions.

Can you help how can i verify that every email with subject FW/RW from Inbox folder is already processed and exists in Completed folder ?

@prerna.gupta

You can use get mails then loop through each mail and check currentitem.subject.contains("FW") or currentitem.Subject.contains("RW") then perform
Move mail in the then side

Make sure in the for loop properties you change the type argument to mailmessage

Or else you can directly try using for each email activity

Also you have options to filter on subject in both the activities

Filter in outlook get mail activities

“@SQL=”“urn:schemas:httpmail:subject”" like ‘%FW%’"

And in for each email activity you have an option to select the filters from drop down directly

Hope this helps

Cheers

This is can implement fetching all emails looping each item and chceking subject is FW/RW. I need to know how can i check weather an email is already present in Completed folder ?
Any query for the same ?

@prerna.gupta

Then you can use get mail from the completed folder…instead of inbox you can change it to completed…

And can use filter on subject or any other attribute which you know

Use the subject obtained from the current email and check using get mail on completed folder and with subject filter…as you already know the full subject you can use it…and mail.count>0 will tell if it is already present in completed

Ideally if the email is moved then i guess it wont be present in two plces

Cheers

This wont work as there are many other operations which i need to perform.

Any other suggestion for checking that an email from Inbox folder exists in Completed folder ?

@prerna.gupta

May I know why you think this would not work…

If you need to check an email is present in a folder then you have to use get mail activity…without that you cannot…

And to check a specific email we have filter options that we can use…and then count the number of mails retreived from the completed folder

Can provide any alternative if you can give more details…but mostly you should be using for email email on completed folder or use get mail activity on completed folder, as these are the only ways that you can get a mail from a mail system

Unless you are storing the mail in a completed folder on a local system…If stored in local system then we need to check in a different way may be by checking the file name and to include some unique attribute to have the mails segregated

cheers

Sure i’ll look into the same

1 Like