How to Filter Power Apps Collection With Search Text Input?

Do you know how to filter Power Apps collection with search text input? Ok, no problem!

This Microsoft Power Apps tutorial explains filtering the Power Apps collection by name with one-text input.

Lastly, I will describe by filtering the Power Apps collection by number column using text input Starts With.

How to Filter Power Apps Collection With Search Text Input

This section will show how to use Power Apps filter search text input.

Example:

I have a SharePoint Online list as ” Loan Approval” that has different columns like:

Column NameData Type
NameTitle
Loan TypeChoice [“Car Loan“, “Gold Loan“, “Home Loan“]
Credit ScoreNumber
Salary Currency
Loan Applied DateDate and time
Approved or NotYes/no
ID ProofImage
Loan Handled byPerson/group
Filter Power Apps Collection With Search Text Input

I created a Power Apps Canvas app and added a Search input box and a Data table control. When a user searches for any name, loan type, Salary, etc., in the search box, the data table will filter and display the result based on the search box value.

Let’s say I searched with the letter “H,” then the data table filtered and displayed all the records based on the H letter.

Power Apps filter collection With Search Text Input

Let me show you how to achieve this:

ClearCollect(colApproval,'Loan Approval')

Where,

  1. colApproval:- Provide a Collection name
  2. Loan Approval:- SharePoint Online list name
Filter Collection With Search Text Input in Power Apps
  • Then, Run the OnStart property to create a collection; the collection will be created as shown below:
How to filter Power Apps Collection With Search Text Input
  • On the Power Apps Screen, insert the Text input control and Search icon as shown below:
Power Apps Collection filter with search Text Input
  • In the text input property, change the Padding-Left to 50 pixels.
How to filter Collection With Search Text Input in Power Apps
  • Insert a Data table -> Set its Items property to:
Filter(
    colApproval,
    StartsWith(
        Title,
        txt_Search.Text
    ) || StartsWith(
        'Loan Type'.Value,
        txt_Search
    ) || StartsWith(
        Salary,
        txt_Search.Text
    ) || StartsWith(
        'Loan Applied Date',
        txt_Search.Text
    ) || StartsWith(
        'Approved or Not',
        txt_Search.Text
    )
)

Where,

  1. colApproval:- Collection name
  2. StartsWith:- The function checks whether one text string begins with another
  3. Title:- SharePoint list Column Name
  4. txt_Search:- Text Input control name
How to Filter the Power Apps Collection With Search Text Input
  • Save, Publish, and Preview the app. When the user searches for details using a text input control, that data will be represented on a data table.
Filter the collection with Search Text Input in Power Apps

I achieved this by filtering the data table using the search text input control.

Power Apps Filter Collection by Name with One Text Input

Let me show you how to filter the Power Apps collection by name with one-text input.

For example, I have created a Power Apps canvas app and added a text input and Gallery control. When a user searches for any User name [Title] in the search box, the gallery will filter and display the result based on the search box value as shown below:

Power Apps Filter Collection By Name with one text-input control

Follow the below steps to achieve this:

  • On the Power Apps screen, insert the Text input control and Search icon as shown below:
Filter Power Apps Collection By Name with one text-input control
  • Insert a Gallery control -> Set its Items property to:
Filter(
    colApproval,
    StartsWith(
        Title,
        txt_UserName.Text
    )
)

Where,

  1. colApproval = Collection name
  2. Title = SharePoint list column name
  3. txt_UserName = Text-input control name
Power Apps Filter Collection Starts With
  • Save, Publish, and Preview the app. When the user searches for a User name using a text input control, that data will be represented on a Gallery.
How to filter Power Apps Collection By Name with one text-input

This way, we can filter the Power Apps collection by name with one-text input.

Power Apps Filter Collection By Number Column Using Text-Input Starts With

This section will explain filtering the Power Apps collection by number column using text input starts with.

For Example, I have created a Power Apps canvas app and added a text input control, Button control, and Gallery control.

When a user searches for Credit Score [Number column] in the search box and clicks on the button control, the gallery will filter and display the result based on the search box value as shown below:

Power Apps filter collection by number column using text-input starts with

Follow the below steps to achieve this:

  • On the Power Apps screen, insert the Text input as shown below:
Filter Power Apps collection by number column using text-input starts with
  • Insert a Button Control -> Set its OnSelect property to:
ClearCollect(
    colCreditScore,
    Filter(
        'Loan Approval',
        StartsWith(
            'Credit Score',
            txt_CreditScoree
        )
    )
)

Where,

  1. colCreditScore = Provide the collection name
  2. Loan Approval = SharePoint list name
  3. Credit Score = SharePoint list number column name
  4. txt_CreditScoree = Text-input control name
How to filter Power Apps collection by number column using text-input starts with
  • Insert a Gallery Control -> Set its Items property to:
colCreditScore 

Where,

  1. colCreditScore = Collection name
Filter a Power Apps collection Starts With
  • Save, Publish, and Preview the app. When the user searches for a Credit Score using a text input control and clicks on a button control, that data will be represented on a Gallery.
How to filter Power Apps collection Starts With

This is how I filtered the Power Apps collection by number column using text input Starts With.

Conclusion

This Microsoft Power Apps tutorial taught us all about the Power Apps filter search text input, which starts with, and many more:

  • Power Apps Filter Collection by Name with One Text Input
  • Power Apps Filter Collection By Number Column Using Text-Input Starts With

Here, I explained when a user searches for any name, loan type, Salary, etc., in the search box, the data table/gallery will filter and display the result based on the search box value.

Also, you may like some more Power Apps tutorials: