cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elsa
New Member

SearchIcon filter formula gets error

I would like to make search function on Gallery using filter formula but always gets error.

I am creating Convas app from Sharepoint List (CPOR/FastTrack FAQ)

Gallery's item setting as below:

Title=Ref

Subtitle=Category

Body=Question

Using filter formula I want to return results which contains the "Search Input" in "Category" or "Question".

So I set formula OnSelect "Searchicon" as Filter( 'CPOR/FastTrack FAQ', TextSearchBox1.Text in Category || TextSearchBox1.Text in Question )

But always gets error as attached.

Please advise how should I edit the formula and get it work as expected.

Note: also tired below formula but still gets error.

         Search('CPOR/FastTrack FAQ',TextSearchBox1.Text, "Category","Question")

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Elsa ,

Do you mean that you set the searchbutton's OnSelect to Filter/Search function?

Please note two things:

1) "OnSelect" is an action. 

You could only set OnSelect property with behavior function , for example: Set,navigate,setfocus ,etc.

Filter/Search function are both not behavior function.

2)The result that filter/Search returns is a table. You need to set this formula to a property that needs a table.

Based on your description, do you want to the gallery filter based on the textinput after you click the searchbutton?

If so, I've made a similar test for your reference:

1)set the searchbutton's OnSelect:

Set(var,false);Set(searchtext,TextSearchBox1.Text)

12242.PNG

 

2)set the screen's OnVisible:

Set(var,true)

12244.PNG

 

3)set the gallery's Items:

If(var,'CPOR/FastTrack FAQ',Filter( 'CPOR/FastTrack FAQ', searchtext in Category || searchtext in Question ))

12243.PNG

 

 //If you not click the button, the gallery will display the whole table, if you click the gallery will filter based on TextSearchBox1.Text.

The gallery's Items will not change with the TextSearchBox1.Text automatically. Only if you click the searchbutton, the gallery's Items will change.

 

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
gabibalaban
Dual Super User
Dual Super User

Hi, 

 

This is not an error, it's a warning that your formula might not work properly on a large amount of data.

It's appear because  "in" operator is not delegable operator for SharePoint. You can try to use StartsWith which is a delegable one, of course the result will not be the one expected (it's StartsWith not in).

 

Please read:

https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/

 

v-yutliu-msft
Community Support
Community Support

Hi @Elsa ,

Do you mean that you set the searchbutton's OnSelect to Filter/Search function?

Please note two things:

1) "OnSelect" is an action. 

You could only set OnSelect property with behavior function , for example: Set,navigate,setfocus ,etc.

Filter/Search function are both not behavior function.

2)The result that filter/Search returns is a table. You need to set this formula to a property that needs a table.

Based on your description, do you want to the gallery filter based on the textinput after you click the searchbutton?

If so, I've made a similar test for your reference:

1)set the searchbutton's OnSelect:

Set(var,false);Set(searchtext,TextSearchBox1.Text)

12242.PNG

 

2)set the screen's OnVisible:

Set(var,true)

12244.PNG

 

3)set the gallery's Items:

If(var,'CPOR/FastTrack FAQ',Filter( 'CPOR/FastTrack FAQ', searchtext in Category || searchtext in Question ))

12243.PNG

 

 //If you not click the button, the gallery will display the whole table, if you click the gallery will filter based on TextSearchBox1.Text.

The gallery's Items will not change with the TextSearchBox1.Text automatically. Only if you click the searchbutton, the gallery's Items will change.

 

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi thanks for the advise.

I have tried with below steps and formula, the first two are applied without any warning or error but the three gets warning as below:

PowerApps SearchIcon warning1.pngPowerApps SearchIcon warning.png

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,667)