cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aka96
Helper I
Helper I

Multiple Text Search boxes SharePoint List

Hi, 

I am new to Power apps.  Help is greatly appreciated!

I want to have 4 search boxes that allow me to search through my SharePoint list.  4 Categories - Title, Skills, Qualifications, Status.  Ideally I would want to be able to search all 4 categories at the same time. 

I would alsoo like a search function that allows me to use the text boxes to search for multiple words in that category and when a word is searched it brings all relevant information across the SharePoint list.  

 

I have tried using but the gallery doesn't display anything, it's blank: SortByColumns(Filter([@AssociateDatabase],StartsWith(Title,TextSearchBox1.Text),StartsWith(Skills,Textsearchbox2.Text),StartsWith(Qualifications,Textsearchbox3.Text),StartsWith(Status,Textsearchbox4.Text)),"Title",Descending) 

 

I have also tried:

Filter(AssociateDatabase,TextSearchBox1.Text in Title||TextSearchBox1.Text in Status|| TextSearchBox1.Text in Rate||TextSearchBox1.Text in Qualifications||TextSearchBox1.Text in 'Based in'||TextSearchBox1.Text in Skills||TextSearchBox1.Text in 'Sector Experience'||TextSearchBox1.Text in Status)

 

When I change TextSearchBox1 to TextSearchBox2 the search function completely stops working 😕.  

 

Filter(Filter(Filter(Filter(Associatedatabase,TextSearchBox1.Text, Title),Textsearchbox2.Text, Skills),Textsearchbox3.Text , 'Qualifications'),Textsearchbox4.Text, 'Status')

All the names in the SharePoint list aren't appearing in the gallery and the gallery sometimes doesn't display any information. 

 

Any help would be greatly appreciated. Thank you!!

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User II
Super User II

@aka96 

Just my two cents but do you really want textboxes to solve this problem.  In general, I like to limit the options given to users because of problems with misspellings, etc.  It is preferable to me to use dropdown controls or multiselect comboboxes when you want to filter for several options.  I use textboxes only when those do not meet the needs.  For example, you can probably use a Dropdown with Distinct(AssociateDatabase, Status) as its items property.  Multiselect Comboboxes with Distinct(AssociateDatabase, Skills) and Distinct(AssociateDatabase, Qualifications and perhaps a TextInput box for the name of the Associate.
The Screenshot below shows a list of Olympic hockey players filtered by a combobox, two dropdowns and a radio control.  The result is searched based on first and last names.  In this example, I used @RandyHayes 's way of adding a blank value called "ALL" to each control and show his formula in the top right hand side of the screen._1.jpg

View solution in original post

15 REPLIES 15
Drrickryp
Super User II
Super User II

@aka96  

You need to specify the type of column (SLOT, Option, Lookup, etc) for your 4 categories in order to determine the proper filter.  

RandyHayes
Super User III
Super User III

@aka96 

First, what types of columns are Title, Skills, Qualifications, Status?  If they are not all Text columns then your formula needs adjustment.

Also, please clarify if your scenario is that all the results in your list would only be comprised of rows that match all conditions of the 4 textinputs, or if it is comprised of rows that match any of the conditions.

 

SortByColumns(
    Filter(AssociateDatabase, 
        StartsWith(Title, TextSearchBox1.Text) &&
        StartsWith(Skills, Textsearchbox2.Text) &&
        StartsWith(Qualifications, Textsearchbox3.Text &&
        StartsWith(Status, Textsearchbox4.Text)
    ),
    "Title",
    Descending
) 

The above is for the scenario where all rows must include searched text from all inputs.

Change the &&'s to || if you want to have rows that match any of the conditions.

 

Keeping in mind again, all of the above columns are assumed to be Text columns.  If you have different...please post back with types.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

They're all text columns. I have used the condition with the || as I don't need all boxes to populated at the same time but do need time provide that choice if the user wanted to search multiple categories. 

 

I have put the condition in and it still doesn't seem to work, it does search for items but not all the correct items.

 

Also would it be possible to use search rather than startswith ?

RandyHayes
Super User III
Super User III

@aka96 

Search will search based on only one of the TextInput controls, not all 4.  Also, it is not delegable.  If you need searching ability and delegation is not a concern, then the use of the IN operator would be what you want.

 

So, with the modification to OR ( || ), the formula should provide results.  You seem to indicate that it does but that they are not correct.  Can you elaborate on that statement?

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@RandyHayes 

I need to be able to have the option to search i.e. skills and status, or skills, status and title or all 4 if needed be. 

Delegation isn't an issue as theirs's only 150 rows in the the SP list, in the future I can't see the list exceeding 500. 

I don't think Startswith is the right function for me and search would be better because some of the words searched in the text boxes would be in the middle of a sentence (if that makes sense). How would I use the search function? Thank you!

 

Search(AssociateDatabase,TextSearchBox1.Text,"Title","Skills","Qualifications","Status") This allows me to search everything in the first text box but I'm not sure how to work it with the rest. 

 

All the items from the list aren't coming through with the startswith i.e. Richard is in the SP list but when searching on the app his name and details aren't coming through. 

 

aka96_0-1618304760308.png

 

 

RandyHayes
Super User III
Super User III

@aka96 

So as mentioned prior, Search will only search from one TextInput against multiple columns.  This is fine if you plan to only have one search input.  If you continue with the 4 search input controls, then you will need to implement something more like this:

SortByColumns(
    Filter(AssociateDatabase, 
        TextSearchBox1.Text in Title ||
        Textsearchbox2.Text in Skills ||
        Textsearchbox3.Text in Qualifications ||
        Textsearchbox4.Text in Status
    ),
    "Title",
    Descending
) 
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@RandyHayes 

I have put what you've suggested but now it doesn't filter anything when I type in any of the search boxes. 😕

RandyHayes
Super User III
Super User III

@aka96 

Are you seeing any errors?

Please send me a screenshot of your Gallery Items property and something that you expect to show results.

Plus a screenshot of your columns from the List Settings in SharePoint.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Drrickryp
Super User II
Super User II

@aka96 

Just my two cents but do you really want textboxes to solve this problem.  In general, I like to limit the options given to users because of problems with misspellings, etc.  It is preferable to me to use dropdown controls or multiselect comboboxes when you want to filter for several options.  I use textboxes only when those do not meet the needs.  For example, you can probably use a Dropdown with Distinct(AssociateDatabase, Status) as its items property.  Multiselect Comboboxes with Distinct(AssociateDatabase, Skills) and Distinct(AssociateDatabase, Qualifications and perhaps a TextInput box for the name of the Associate.
The Screenshot below shows a list of Olympic hockey players filtered by a combobox, two dropdowns and a radio control.  The result is searched based on first and last names.  In this example, I used @RandyHayes 's way of adding a blank value called "ALL" to each control and show his formula in the top right hand side of the screen._1.jpg

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (60,355)