Check if email exists then run flow decision ui path

I am trying to check for a specific email that contains a particular subject and if this is true execute a particular sequence. If not then carry out a different sequence.
I am able to identify the specific email. But the problem I have is, how to structure the “if” condition in the “for each” mail, to then trigger a particular workflow based on a true or false.
Do I use get outlook, and have “if” condition to trigger “flow decision”, or do I put the mail condition as a VB expression itself? If so, how do I do this?

Thanks in advance.

Hi @ekmlsbl - If you are able to check the e-mail as per your requirement then inside the ForEach for Email either you can use If condition or Flow Chart with the decision. Hence once you got the subject or e-mail for your requirement then you can Invoke the process or steps whichever you wanted to trigger.


Hi @AnandKumar26
Thanks for you response. I understand what you mean, having trouble to visually seeing how it would look, do you have an example workflow I could possibly look at?



you got the idea right. Try this:

For Each mail in your List of MailMessage: If

Cheers, Lukas

Hi this is just an example. a part of a past project of mine. adjust the if condition according your needs. the currect condition searches for a specific mail/subject with any attachments in a timespan: today to the past 10 days.
don’t forget to set the “top” property of “get outlook mails” according to your needs. in this example it collects the top 20 for the loop and if condition.
Example.xaml (6.4 KB)

Hello @ekmlsbl

Thank you for your inquiry ! :slight_smile:

So basically, you need an if activity,


I am attaching a workflow for your guidence.

If this answer your question please mark it as solve and like our post!
Happy Automation :slight_smile: ekmlsbl_Email.xaml (22.9 KB)

1 Like

Thank you, this is what I was looking for!

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