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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter array for date ...
Power Automate
Answered

Filter array for date greater than today

(0) ShareShare
ReportReport
Posted on by 727 Super User 2025 Season 2
Hello - 
 
Trying to filter an array for records with Promotion Start Date greater than today.
I figured a basic query would work but it does not. It likely requires date formatting and a UTC expression, but I cannot get the syntax correct for an advanced query either.
 
Any suggestions?
 
Example input to the filter:
 
 
Basic filter that does not work:
My failed attempt to write advanced query:
@equals({formatDateTime(item()?['Promotion Start Date'],'yyyy-MM-dd')},{formatDateTime(addDays(utcNow()+1,'yyyy-MM-dd'))})
 
Any guidance would be greatly appreciated!
 
Thanks, Chris
Categories:
I have the same question (0)
  • Suggested answer
    SpongYe Profile Picture
    5,609 Super User 2025 Season 2 on at
    Hi,
     
    Your advanced query would look like:
    @equals(
        formatDateTime(item()?['Promotion Start Date'], 'yyyy-MM-dd'), 
        formatDateTime(addDays(utcNow(), 1), 'yyyy-MM-dd')
    )
     
    Hope this helps!
  • Suggested answer
    KT-11121621-0 Profile Picture
    14 on at
    Hi,
     
    1. Your filter query should use the object that you select using the Dynamic content builder.  You select it from the list in the pop-up.
    2. The expression on the right-hand side should be: formatDateTime(utcNow()).  You'll need to use the Dynamic content builder to type the expression
     
    Here's what the advanced filter should look like:
     
    @greater([your_date_field], formatDateTime(utcNow()))
     
    ** what if the Promotion date is today? you can use greater than or equal as well.
     
     
    Good luck and let us know how it goes.
  • Cgangweg01 Profile Picture
    727 Super User 2025 Season 2 on at
    Hello @SpongYe
    Thank you so much! That worked but I did have to change it to @ greater than.
     
    I don't have this syntax down yet ... I want to make that advanced query a combined one with 'And' ...
     
    @equals(item()?['Price Type'],'STORE')
     
    Any suggestion for that?
     
    Thanks Again!
     
     
  • Verified answer
    SpongYe Profile Picture
    5,609 Super User 2025 Season 2 on at
     
    Then the code would look like:
    @And(
        greater(
            formatDateTime(item()?['Promotion Start Date'], 'yyyy-MM-dd'), 
            formatDateTime(addDays(utcNow(), 1), 'yyyy-MM-dd')
        ),
        equals(
            item()?['Price Type'],
            'STORE'
        )
    )
     
  • Cgangweg01 Profile Picture
    727 Super User 2025 Season 2 on at
    Thank you!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard