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 Automate
Answered

Filter Query by Date

(3) ShareShare
ReportReport
Posted on by 29
Hi there!
 
I had my flow set up to run once a week with all of the data from the following week. However, it has been decided that we need the data to run twice a week, once on Thursday mornings to grab the data from Monday- Wednesday, but then we need it to run on Friday at noon and only want the data that came in on Thursday and Friday. With that, how can I filter the data to only show me the days I need for each run? 
There is no data coming in over the weekend, and I also don't want to risk the Thursday run pulling data from the prior week.
I have tried several ways by doing a filter query and I tried but setting a condition, but nothing seems to work. 
I am including the flow with current set up for clarity of what I am working with.
Categories:
I have the same question (0)
  • Verified answer
    ivan_apps Profile Picture
    2,189 Moderator on at
    It would be important to know the schema of your excel document. I assume there is a ‘created on’ or some other date column that allows you to know what date the data came in at. You then can use utcNow() and dayOfWeek() expressions to determine what day you are executing on if you are set to run Wednesdays and Friday. In either case you basically are doing an addDays(utcNow(), -2) to set your start date. Use formatDateTime() to adjust to whatever time you need, then use the following sample Odata query:
     
    createdon ge addDays(utcNow(), -2) and createdon le utcNow()

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 598

#2
Valantis Profile Picture

Valantis 477

#3
Vish WR Profile Picture

Vish WR 370

Last 30 days Overall leaderboard