cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

StartsWith -- “The requested operation is invalid"

 

How do we filter using StartsWith for multiple conditions, while maintaining the ability to see beyond 500 items in the gallery?

 

I am having challenges with executing a query where I have more than one condition using StartsWith.  Originally, I thought it was just using the || operator but I saw the same with the && operator.

 

The error message when there are multiple conditions using StartsWith is “The requested operation is invalid. Server Response: The query is not valid.” 

 

I set the Items property of the Gallery.  Here is the original query

 

The requested operation is invalidThe requested operation is invalid

After having taking the query down to its simplest form, I see the problem still exits.

 

Individually, these queries are valid (ugvl is a test field)

 

Filter(TestList, StartsWith( UserDisplayName, TextSearchBox1.Text ) )

Filter(TestList, ugvl = "1" )

 

However together, they are considered not valid

 

Filter(TestList, StartsWith( UserDisplayName, TextSearchBox1.Text ) || ugvl = "1" )

 

Simplified QuerySimplified Query

 

In the simplification, the query appears to fail, however if you execute it, it actually does work, provided there is input in TextSearchBox1.Text. Note, this is not required when StartsWith(…) is the only condition.

 

Now, this can be overcome but at a much higher level of complexity in the query by using IF and IsBlank

 

SortByColumns( If(IsBlank(TextSearchBox1.Text),TestList,Filter(TestList,StartsWith( GivenName, TextSearchBox1.Text ) || StartsWith( SurName, TextSearchBox1.Text ) )),"UserDisplayName", If(SortDescending1, Descending, Ascending))

 

Almost Works CorrectlyAlmost Works Correctly 

 

This appears to work perfectly on the surface, albeit with more complexity, however, once you add IF and IsBlank, the item gallery visibility is decreased back to 500 items.  You can no longer scroll to see items past 500.

 

It may be considered that seeing items beyond 500 is insignificant, however from a user’s perspective, if you scroll or sort the list and items are missing, this is definitely major.

 

So what is it that I am not considering? How might we filter using StartsWith on multiple conditions, while maintaining the ability to see beyond 500 items in the gallery?

1 REPLY 1
Highlighted
Anonymous
Not applicable

Re: StartsWith -- “The requested operation is invalid"

I forgot to mention, I am using a SharePoint list as my source of data, which has greater than 500 items but less than 1,000.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,750)