Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Conditional Function based on Excel table with a Query Filter and using date range

(0) ShareShare
ReportReport
Posted on by 46

Here is my flow, scheduled to run once a week.

ABoyNamedSue_0-1698101448644.png

The List row present in a table action has a Filter Query and when I test it, it works as expected.

ABoyNamedSue_1-1698101931625.png

Here is where I need help. For my condition, I need it to look for a date range for the past seven days. The flow is scheduled to run on Wednesdays, and the date range should be from the Tuesday before to the previous Wednesday. I know I can have this set up to run based on the current date but cannot get the right expression to make it happen. I also tried to initialize variables for the date and get nothing but error messages when trying to save. 

 

I appreciate your help!

  • ABoyNamedSue Profile Picture
    46 on at
    Re: Conditional Function based on Excel table with a Query Filter and using date range

    Thanks! Tested it and success!

  • Verified answer
    lbendlin Profile Picture
    8,045 Super User 2025 Season 1 on at
    Re: Conditional Function based on Excel table with a Query Filter and using date range

    sorry about that.

     

     

    convertFromUtc(addDays(utcNow(),-7),'Central Standard Time','yyyy-MM-dd')

     

  • ABoyNamedSue Profile Picture
    46 on at
    Re: Conditional Function based on Excel table with a Query Filter and using date range

    Using that expression gives me an error message.

     

    ABoyNamedSue_0-1698178847905.png

     

  • lbendlin Profile Picture
    8,045 Super User 2025 Season 1 on at
    Re: Conditional Function based on Excel table with a Query Filter and using date range
    convertFromUtc(utcNow()-7,'Central Standard Time','yyyy-MM-dd')
  • ABoyNamedSue Profile Picture
    46 on at
    Re: Conditional Function based on Excel table with a Query Filter and using date range

    Hi @lbendlin,

    I am UTC-6. The automation I am running is goes to all US states and territories. I have it scheduled to run at 1300 local time, so it is not too early or late for the majority of the time zones (sorry people in Guam). If I use UTC, would it not be the next day and throw off the dates?

  • lbendlin Profile Picture
    8,045 Super User 2025 Season 1 on at
    Re: Conditional Function based on Excel table with a Query Filter and using date range

    Please define what you mean by "current date".  UTC or local timezone?

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

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

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1