cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DaveNicholls
Frequent Visitor

The requested operation is invalid. Server Response: The query is not valid

I seem to be having an odd error with a Powerapps gallery. The gallery is based on a Sharepoint list and filters the list for the gallery on the basis of 3 Dropdown box values (Consultant, Site and User) and a toggle switch (Show/Hide Completed Items). As each of the Dropdowns also have an 'All' option, I have used the formula below. The switch sets a variable to true to filter the list by completed items.

Filter(TaskCalendar, 
 drpConsultantFilter_2.SelectedText.Result = "All Consultants" Or drpConsultantFilter_2.SelectedText.Result = Consultant,
 drpSiteFilter_2.SelectedText.Result = "All Sites" Or drpSiteFilter_2.SelectedText.Result = Site,
 drpUserFilter_2.SelectedText.Result = "All Users" Or drpUserFilter_2.SelectedText.Result = 'Assigned To',
 ShowCompleteVar Or 'Date Received'=Blank())

The odd thing is that the filter seems to work exactly as designed, but I whenever the app is run I get the error "The requested operation is invalid. Server Response: The query is not valid." 

Seeing as it seems to be working OK, is this safe to conclude this is a false positive or am I overlooking something?

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions

 

Solution eventually worked out as below. 

Thanks to Sik for putting me on the right track!

        Filter(TaskCalendar,
Or(drpConsultantFilter_2.SelectedText.Result = "All Consultants",Consultant = drpConsultantFilter_2.SelectedText.Result),
Or(drpSiteFilter_2.SelectedText.Result = "All Sites",Site = drpSiteFilter_2.SelectedText.Result),
Or(drpUserFilter_2.SelectedText.Result = "All Users",'Assigned To' = drpUserFilter_2.SelectedText.Result),
Or(ShowCompleteVar,'Date Received'=Blank()))

 

 

View solution in original post

4 REPLIES 4

Hi @DaveNicholls 

 

Can you try to update your expression as:
 
Filter(TaskCalendar,
 If(drpConsultantFilter_2.SelectedText.Result = "All Consultants",true, Consultant = drpConsultantFilter_2.SelectedText.Result),
 If(drpSiteFilter_2.SelectedText.Result = "All Sites",true, Site = drpSiteFilter_2.SelectedText.Result),
 If(drpUserFilter_2.SelectedText.Result = "All Users" , true, 'Assigned To' = drpUserFilter_2.SelectedText.Result),
 Or(ShowCompleteVar,IsBlank('Date Received')))
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
v-siky-msft
Community Support
Community Support

Hi @DaveNicholls ,

 

There is something wrong with your logical test part of your filter function. it should deal with field, therefore, the field name must be the left of equals.

so please modify your formulas as follow:

Filter(TaskCalendar, 
 drpConsultantFilter_2.SelectedText.Result = "All Consultants" Or Consultant = drpConsultantFilter_2.SelectedText.Result,
 drpSiteFilter_2.SelectedText.Result = "All Sites" Or Site = drpSiteFilter_2.SelectedText.Result,
 drpUserFilter_2.SelectedText.Result = "All Users" Or 'Assigned To' = drpUserFilter_2.SelectedText.Result,
 ShowCompleteVar Or 'Date Received'=Blank())

Best regards,

Sik 

Thanks Sik,

That was the simplest solution, and it has cleared everything up! I got the idea for the filter formula from a post somewhere and thought it was odd that the column was to the right of the '=', but didn't question it.

 

Thanks for your help.

 

[edit] Unfortunately the solution didnt actually work eventually, the error happened again. Eventual solution worked out and shown below

 

Solution eventually worked out as below. 

Thanks to Sik for putting me on the right track!

        Filter(TaskCalendar,
Or(drpConsultantFilter_2.SelectedText.Result = "All Consultants",Consultant = drpConsultantFilter_2.SelectedText.Result),
Or(drpSiteFilter_2.SelectedText.Result = "All Sites",Site = drpSiteFilter_2.SelectedText.Result),
Or(drpUserFilter_2.SelectedText.Result = "All Users",'Assigned To' = drpUserFilter_2.SelectedText.Result),
Or(ShowCompleteVar,'Date Received'=Blank()))

 

 

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.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,094)