Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Get Items Filter Query - what changed?

(0) ShareShare
ReportReport
Posted on by 48

For the past 6 months my workflow worked great until today. Now I'm getting an error in Get Items filter. 

Here's my filter:

The expression "(License_x0020_Status eq 'Issued') and (Company_x0020_Name eq 'XXXXX') and (Expiration_Date ge '2024-04-30T17:28:58.3452956Z'(),90) and (Expiration_Date le '2024-07-29T17:28:58.3453004Z') " is not valid. Creating query failed.

 

Does anyone have any ideas why this is now failing? Is anyone else having this issue? 

sdaniel_0-1714498668322.png

I would greatly appreciate any help. 

  • CRMCrazy Profile Picture
    48 on at
    Re: Get Items Filter Query - what changed?

    You're a rock star. That worked, thank you so much!!

  • Verified answer
    David_MA Profile Picture
    11,489 Super User 2025 Season 1 on at
    Re: Get Items Filter Query - what changed?

    I am not positive, but I think it is the last part of your expression. I don't believe ' ' is valid. Also, the parentheses are not needed around the individual filters. You only need to add parentheses when you want to combine filters for the required logic to work. Since you have or at the end, I think you really need the following expression to return what you need:

    Expiration_Date gt '@formatDateTime(addDays(utcNow(),-90)','yyyy-MM-dd')' and Expiration_Date lt '@formatDateTime(addDays(utcNow(),90),'yyyy-MM-dd')' and (Action eq 'Accepted' or Action eq null)

    Note, for the filter query, you type the word null instead of choosing null from the expression builder. If you use null from the expression builder, it will not work.

  • CRMCrazy Profile Picture
    48 on at
    Re: Get Items Filter Query - what changed?

    Thank you David. I tried that (see below) and still got a Bad Request Error. Here is what the complete filter looks like. 

    sdaniel_1-1714577651880.png

     

    (Expiration_Date gt '

    '(formatDateTime(addDays(utcNow(),-90),'yyyy-MM-dd')' and (Expiration_Date lt '(formatDateTime(addDays(utcNow(),90),'yyyy-MM-dd')') and (Action eq 'Accepted') or (Action eq ' ')

    Here's the error message.

    "The expression \"(License_x0020_Status eq 'Issued') and (Company_x0020_Name eq 'NCA') and (Expiration_Date gt '2024-02-01' and (Expiration_Date lt '2024-07-30') and (Action eq 'Accepted') or (Action eq ' ')\" is not valid.

     

    Any ideas?

  • David_MA Profile Picture
    11,489 Super User 2025 Season 1 on at
    Re: Get Items Filter Query - what changed?

    Did you mean to say, when the expiration date is greater than today -90 days and less than today +90 days? In other words, everything within plus or minus of 90 days from today.

     

    If so, you would use the expression (example uses the Created date):

     

    Created gt '@{formatDateTime(addDays(utcNow(),-90),'yyyy-MM-dd')}' and Created lt '@{formatDateTime(addDays(utcNow(),90),'yyyy-MM-dd')}'

     

     Be sure to include the single quotes in the expression and use the expression builder for the two values. If done correctly, it will look like this in your action.

    David_MA_0-1714564864464.png

     

  • CRMCrazy Profile Picture
    48 on at
    Re: Get Items Filter Query - what changed?

    Thank you again. Quick question. I'm trying to filter my SP list to pull items with and Expiration Date less than today minus 90 days and greater than today plus 90 days. l've tried ever combination I can think of to get the results but to no avail. 

    (Expiration_Date ge '(utcnow())' and (Expiration_Date le '(addDays(utcnow(),90')

    (Expiration_Date ge '(addDays(utcnow(),90') and Expiration_Date le '(addDays(utcnow(),90')

     

    Do you have any ideas? 

  • Verified answer
    David_MA Profile Picture
    11,489 Super User 2025 Season 1 on at
    Re: Get Items Filter Query - what changed?

    Looking at the Expiration_Date portion of your filter query, that may be the problem. I don't believe the "(),90" at the end is valid.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May 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 >