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 / Get Items Filter Query...
Power Automate
Unanswered

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. 

Categories:
I have the same question (0)
  • Verified answer
    David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    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.

  • CRMCrazy Profile Picture
    48 on at

    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? 

  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    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

    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?

  • Verified answer
    David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    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

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

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard