cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gardnerlhwrc
Helper II
Helper II

Filter Query - Wont let me use and

Hey All,

 

So filter query is no longer my best friend..For some reason its driving me made. I want to use it but keeps erroring. 

 

Heres what I have. 

 

CompletedDate ge addDays(utcNow(),-10,'yyyy-MM-dd') and 3MonthCheck eq true
 
Getting the following error
{"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The expression \"CompletedDate ge '2022-03-04' and 3MonthCheck eq true\" is not valid."}}}
 
I tried adding a condition rather than adding it in the filter query..It works but rather then sending me one email with a table of all the data that meets the conditions I get 1 email for each match and the table as well. 
 
gardnerlhwrc_0-1647266379133.png

 

Where am I going wrong. 

 

Thanks L

1 ACCEPTED SOLUTION

Accepted Solutions
KvB1
Solution Sage
Solution Sage

The name of the column as you see it in sharepoint isn't always how its seen by PA. You need the name as PA sees it. To figure that out you run the fetch items from sharepoint block without the filter thats giving you problems, so you can see what it fetches, and what the columns, and other things you might want to use as a filter criteria, are called.

View solution in original post

7 REPLIES 7
gardnerlhwrc
Helper II
Helper II

Ok just checking a couple of things. I double checked and saw my column name was incorrect so i've change that and the error is different. 

 

CompletedDate ge '@{addDays(utcNow(),-10,'yyyy-MM-dd')}' and _x0033_MonthCheck_x003f_ eq true

 

Column '_x0033_MonthCheck_x003f_' does not exist. It may have been deleted by another user.

gardnerlhwrc_0-1647267743333.png

 

KvB1
Solution Sage
Solution Sage

In the output of the fetch items action it should say the exact phrasing of the column, as automate sees it

 

Also, if you dont need to create an action for the condition if it fails, you can add this in a filter or maybe even http request if you feel like doing that (would make it more flexible)

gardnerlhwrc
Helper II
Helper II

Thanks for your quick reply. I've checked the output but i must admit not totally sure what i'm looking for everything looks to be right. 

"$filter""CompletedDate ge '2022-03-04' and _x0033_MonthCheck_x003f_ eq true"
 
I see this from the output download.
"status":400,"message":"Column '_x0033_MonthCheck_x003f_' does not exist. It may have been deleted by another user
KvB1
Solution Sage
Solution Sage

If you just use the odata filter without the month check: CompletedDate ge '@{addDays(utcNow(),-10,'yyyy-MM-dd')}'

 

You should get returns since this part of the filter seems to work fine. In the output, it will show the name of the column in the way its recognized by PA

gardnerlhwrc
Helper II
Helper II

gardnerlhwrc_0-1647269011268.png

 

 

body":{"status":400,"message":"Column '_x0033_MonthCheck_x003f_' does not exist. It may have been deleted by another user
        "$filter""_x0033_MonthCheck_x003f_ eq true"
So just messing about, doing my own testing. If I create a new column that doesn't have some dodgy reference it works
Example - I made a threeMonthCheck column and replace the filter and it all is well. 
I'll have to make some changes to my add to see the new column (which is fine but still be good to know why it doesn't work)

 

KvB1
Solution Sage
Solution Sage

The name of the column as you see it in sharepoint isn't always how its seen by PA. You need the name as PA sees it. To figure that out you run the fetch items from sharepoint block without the filter thats giving you problems, so you can see what it fetches, and what the columns, and other things you might want to use as a filter criteria, are called.

gardnerlhwrc
Helper II
Helper II

I understand what you're saying now. Thank you very much that worked...It was looking for this

 

OData__x0033_MonthCheck_x003f_ 

 Changed that and boom!

 

Amazing thanks for you patience. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (1,145)