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 / Get Emails (V3) - Sear...
Power Automate
Answered

Get Emails (V3) - Search Query for Emails more than 7 days old dynamic expression help needed

(0) ShareShare
ReportReport
Posted on by 94

Hi, 

 

I have configured a flow to automatically move sent emails from a shared mailbox using a compose function to the archive folder, which works.  But I'd like to have a dynamic query so that it lets emails younger than 7 days stay in the "regular" sent for quick reference before moving. 

 

Right now I have it moving ones sent yesterday, so I know I change the -1 to -7 - I can't figure out how to configure the "greater than" conditional in the Search Query field.  Right now this would only move ones dated yesterday, and I want all older than 7 days: 

 

GetEmails.png

Any assistance is appreciated! 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Fsomers68 ,

     

    Please try:

    received>@{addDays(utcNow(),-7,'yyyy-MM-dd')} AND received<@{addDays(utcNow(),-1,'yyyy-MM-dd')} 

    vbofengmsft_0-1663913436793.png

     

    Best Regards,

    Bof

     

  • Fsomers68 Profile Picture
    94 on at

    Thank you.  I tried that and it only moved items that were younger than seven days but kept today.  The three in red were the ones that moved.  I would have wanted the 9/15 one to move and everything else to stay.  Tomorrow, the 9/19 email would move: 

     

    SentEmailFlow.png

  • Verified answer
    Fsomers68 Profile Picture
    94 on at

    Ok, I was able to figure it out after laying it out in a spreadsheet.  Didn't need two expressions: 

    SentSolution.PNG

     

    Thank you for your help! 

  • VictorIvanidze Profile Picture
    13,081 on at

    Here is a free flow with same functionality that can work with any amount of emails:

    https://ivasoft.com/archiveemailsflow.shtml

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 1,027

#2
Valantis Profile Picture

Valantis 809

#3
Haque Profile Picture

Haque 645

Last 30 days Overall leaderboard