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

Browse gallery filtering with textsearchbox

Hi everyone,

 

I have an app linked to a SharePoint list. I would like to combine the filtering conditions I have with a textsearchbox which identifies part of the text.

My browse gallery shows registration plates, and I want the textsearchbox to filter them just introducing part of the numbers and letters of the plate.

 

Righ now I have the following formula to filter the gallery:

 

Distinct(Filter(SPList;Or('Condition 1;'Condition 2;'Condition3) &&' Condition4);ColumRegistrationumber)

 

¿How can I add to this filter one like the one that follows?

Filter(SPList; TextSearchBox1.Text; ColumRegistrationumber)

 

¿Is there any alternative way to get this filter?

 

Thank you very much!

 

Regards,

Masoud9

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Browse gallery filtering with textsearchbox

Hi @Anonymous 

If you are working with a SharePoint datasource, you would need to use the "in" operator. Your formula containing the Distinct() function produces a one column table with a column named Result.  Assuming that your current formula works, then 

Filter(Distinct(Filter(SPList;Or('Condition 1;'Condition 2;'Condition3) &&' Condition4);ColumRegistrationumber);
TextSearchBox1.Text in Result)

should search the Result column for any item containing part or all of the plate numbers.  However, "in" is not delegatable in SharePoint so the number of items resulting from your filter would need to be less than the delegation limit. 

Another way to do it would be to create a collection using your formula and then you could use the Search() function on the collection.  In that case, you would use

ClearCollect(colRegNumbers, Distinct(Filter(SPList; Or('Condition 1; 'Condition 2; 'Condition3) &&' Condition4);
ColumRegistrationumber))

 as the OnSelect property of a button and then set the Items property of the gallery to 

Search(colRegNumbers; TextSearchBox1.Text; Result)

You would still run up against a delegation problem since ClearCollect() and Collect() are not delegatable but there would be no delegation error in the Items property of the gallery.

 

2 REPLIES 2
Super User
Super User

Re: Browse gallery filtering with textsearchbox

Hi @Anonymous 

If you are working with a SharePoint datasource, you would need to use the "in" operator. Your formula containing the Distinct() function produces a one column table with a column named Result.  Assuming that your current formula works, then 

Filter(Distinct(Filter(SPList;Or('Condition 1;'Condition 2;'Condition3) &&' Condition4);ColumRegistrationumber);
TextSearchBox1.Text in Result)

should search the Result column for any item containing part or all of the plate numbers.  However, "in" is not delegatable in SharePoint so the number of items resulting from your filter would need to be less than the delegation limit. 

Another way to do it would be to create a collection using your formula and then you could use the Search() function on the collection.  In that case, you would use

ClearCollect(colRegNumbers, Distinct(Filter(SPList; Or('Condition 1; 'Condition 2; 'Condition3) &&' Condition4);
ColumRegistrationumber))

 as the OnSelect property of a button and then set the Items property of the gallery to 

Search(colRegNumbers; TextSearchBox1.Text; Result)

You would still run up against a delegation problem since ClearCollect() and Collect() are not delegatable but there would be no delegation error in the Items property of the gallery.

 

Anonymous
Not applicable

Re: Browse gallery filtering with textsearchbox

Thank you very much @Drrickryp , that was perfect!

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 295 members 3,993 guests
Please welcome our newest community members: