web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Reading outlook emails
Power Automate
Unanswered

Reading outlook emails

(0) ShareShare
ReportReport
Posted on by 164

Hi all, what i have here is read emails from outlook. I have created a variable "Formatted previous day" to get the previous day and check if the email is from the previous day, then it will add to the list. However, at the same time, i also want to read and check the subject if it contains Success too.

 

So ultimately, unless it meets both conditions, then it will be added into the list. How can i do it? What i did now does not work as how i want it to be as PAD  does not add the things in the list

Alphadrag_2-1654677527648.png

 

 

 

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    Hi @Alphadrag 

     

    The logic you have written appears to be correct (although you can add an AND condition but not needed right now).

     

    Debug the process by stepping through and check which "IF" condition is failing.

     

    Post back your findings.

     

     

     

  • Alphadrag Profile Picture
    164 on at

    Hi, i got it working already. Not sure if the issue is that it cannot compare datetime with text value. The currentmail.Date is in datetime format. Thus, i converted that into text and compared that value with the formattedpreviousday variable.

     

    Alphadrag_0-1654753397736.png

     

     

     

  • Alphadrag Profile Picture
    164 on at

    I have another question, for the retrieve outlook messages. Is there any way where i can make it only retrieve from the previous day or lets say just this year? because since its reading other years as well, it is taking a long time

  • VJR Profile Picture
    7,635 on at

    The "Retrieve Email messages" as of now does not have the filter by date option so the only way for now could be to check the date condition after all the emails are fetched.

     

    One option you can think of is to add a rule to your Outlook to automatically move all emails prior to the previous day to some other Outlook Sub folder so that your Inbox will always have emails starting from the previous day.

  • Alphadrag Profile Picture
    164 on at

    i thought of a way to only read by year as in my body for email content, there will always be year thr so i set to 2022. However, another issue i have here is:

     

    I have 4 things i want to see from the subject and only retrieve them. They are success, backup, warning & failed. Is it possible to do a OR inside the part "Subject contains"?

     

  • VJR Profile Picture
    7,635 on at

    No in-built feature as such. You will have to check via loop.

    OR

    Perhaps for that too you can create a rule to filter out as per multiple words in subject

     

     
     VJR_4-1654766273434.png
  • Alphadrag Profile Picture
    164 on at

    How do i check via loop in this subject part? cuz there are multiple subject names that i want to put in the "subject contains" part. 

    Alphadrag_0-1654768144891.png

     

  • VJR Profile Picture
    7,635 on at

    Since there is nothing in-built I was referring the lengthy method to get all the emails and then within the loop do a string compare with the various keywords of the subject.

     

    What happened with the easier alternative of creating a rule with different matching keywords in the subject, which will automatically move those emails in a different Outlook subfolder and then have PAD read those emails from this subfolder?

  • Alphadrag Profile Picture
    164 on at

    All those emails are already being auto moved to the subfolders, so that cant be changed. Thus, ur solution on creating a rule cannot be applied to my case. So now, i only can do via the subject

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Been on vacation, glad to be back. Just got your message. What if you retrieve 4 different sets of emails?

     

    Using the same logic you’ve already created except the first Retrieve emails is subject contain success to %RetrievedEmailsSuccess%

     

    then you retrieve emails where subject contains backup to %RetrievedEmailsBackup%

     

    Con, it runs retrieve emails 4 times; however, pro, your subjects are already separated, so if you are processing these 4 differently, all the emails in each variable will be processed the same. 

    best of luck!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 210 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 175

Last 30 days Overall leaderboard