Skip to main content

Notifications

Community site session details
Power Automate - General Discussion
Answered

Flow - Delete emails older than 7 days

Like (0) ShareShare
ReportReport
Posted on 11 Apr 2019 08:13:35 by 5

Hi There,

I'm trying to create a Flow to delete messages older than 7 days in Folder, but I have a problem.

 

This is my Flow:

flow01.JPG

 

When in the field Search Querry I add "received:yesterday", the flow is working, and the messages are successfully processed, but when I add  "received:last week" not working.

 

This is the output:

 

flow04.JPG

 

This is the output with "received:last week" in the query:

 

flow03.JPG

 

I tried to add the search query in double quotes, but in this case, the flow fails.

 

in the email folder, there is a lot of messages from the last 10 days (02 to 11 of April)

 

One more question - into the TOP field in "Get emails" step, I'm trying to put more than 25 items, but in this case, the Flow fails again. Is there a limitation for this?

 

Thanks in advance for any idea,

Krasimir

 

 

  • Verified answer
    v-bacao-msft Profile Picture
    on 11 Apr 2019 at 10:36:38
    Re: Flow - Delete emails older than 7 days

    Hi @Krasimir ,

     

    Please consider directly comparing the current time and the time the message was received, and then delete the eligible email.

    Expression reference:

    formatDateTime(item()['DateTimeReceived'],'yyyy-MM-dd')
    addDays(utcNow(),-7,'yyyy-MM-dd')

    Image reference:50.PNG

    Please take a try.

     

    Best Regards,

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Automate - General Discussion

#1
stampcoin Profile Picture

stampcoin 23

#2
Pstork1 Profile Picture

Pstork1 20 Most Valuable Professional

#3
Gprior Profile Picture

Gprior 19

Overall leaderboard
Loading complete