Microsoft Power Apps

5 steps to implement word based search in Power Apps

A common requirement in Power Apps is to create a word based search on data in galleries.

Step 1 – Basic search in Power Apps

First of all I would like to have a look at some basic (not working so well) search on data in galleries.

In my example here I’m using a SharePoint list as my data source, but there is no real difference between SharePoint and Dataverse or SQL in this case.

Imagine I have an app as shown below with a textinput control and a gallery displaying list items.

To offer a basic search you could use the following code:

If(TextInput1.Text = "",
  Filter(Actions, TextInput1.Text = Title)

The above code will exactly match the Title field in my data with the text typed into the search box. First issue here of course is that we want to partly match the search text with the data, so that When I type part of the Title field I will also get the data returned.

Step 2 – Partly match search text

This is going to be a small change to the above code. Just replace the = with the in and the search will now work on just typing part of a word.

If(TextInput1.Text = "",
  Filter(Actions, TextInput1.Text in Title)

Notice that you will get a delegation warning on the in operator when you use SharePoint as a datasource.

In general I would consider alternative data source solutions when using larger volumes of data anyway as you may see some delegation warnings.

Step 3 – Searching multiple fields

Now if you wanted to search on multiple field you could also check multiple fields for your search text as shown below:

Still all quite simple stuff, but however about searching for each of the words that we type in the search box.

When the user searches for “List Connectors” the fiirst item in the above screenshot will appear in the results, but just imagine if a user searched for “Connectors List”, they would not get any records returned. As the total set of characters in “Connectors List” doesn’t appear in the data there will be not results returned.

Step 4 – Word based search

Now we could use somethign like this if there are two words that we are searching for:

If(TextInput1.Text = "",
  Filter(Actions, (First(Split(TextInput1.Text, " ")).Result in Title) && (Last(Split(TextInput1.Text, " ")).Result in Title)  )

Now all we have to do is check now just the first and last word but check all the words.

Step 5 – Word based search

To make this all work I updated the search box OnChange code to include the following code:

        " "
                    colWords[@Result] in Title
            Title: Title,
            Description: Description,
            Connector: Connector

And my Items property on the Gallery now needs to be set to:


By doing this the Words that were typed into the search box will be split by the space character and the colResults collection will contain all the items that include the words that I have been looking for.

Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using

Recent Posts

Create multi user real time apps in Power Apps

When multiple users edit data and you want your app to show real time data,…

2 weeks ago

Sort by Title in your Highlighted Content web part in SharePoint

Yesterday I was asked about how to sort Documents in the Highlighted Content web part…

2 weeks ago

Copy large files from SharePoint to Azure Blob Storage using Power Automate

When you try to copy large files from SharePoint to Azure Bob Storage with Power…

2 weeks ago

Sort an array by dates in Power Automate

When we use the Sort function to sort arrays in Power Automate, it is soo…

3 weeks ago

New! Format data by examples in Power Automate

This feature "Format data by examples" will kill one of my most popular posts! How…

1 month ago

Named formulas in Power Apps using App.Formulas

Do you use the App onstart to set a lot of variables? And then do…

1 month ago