PowerApps – enhance Combo Box search functionality

1+

Even out of the box PowerApps is a great tool that provides lots of functionality. Way more than InfoPath could. However, most of the time with very few adjustments it is possible to achieve even more. A great example would be a Combo Box and its search ability.

Let’s create a SharePoint list with a Choice column and these values:

It doesn’t really have to be a Choice column, you might as well use a Lookup column.

When a PowerApps form is created, the studio creates a Data Card and a Combo Box control associated with that Choice field.

Let’s see how the search in that Combo Box works and why it is limited in its current state. Note how it finds BK but doesn’t find Black. The search has a StartsWith behavior.

What if it is necessary to search for a word regardless of its position. Well, that’s very easy to adjust. All you need to do is unlock the very Data Card, go to Combo Box control, find Items property and change its code to:

Filter(
    Choices(testcolors.TCColors),
    DataCardValue2.SearchText in Value
)

RESULT

1+

This Post Has 9 Comments

  1. Zach Welding

    LIFE SAVER!!! thank you so much. crazy how you can spend so much time trying to figure out something so simple(simple after finding this that is.)

    0
    1. Pavel Bludov

      You are welcome, Zach!
      I’m glad my post was helpful!

      0
  2. Abhishek Garg

    This is an amazing post, and came at the right time for me. I have been searching for the exact issue from more than a week now, being a beginner with PowerApps.
    Thank you so much 🙂

    0
    1. Pavel Bludov

      Hey Abhishek,
      I’m happy it was helpful!
      Stay safe!

      0
  3. Andy

    Why wouldn’t Microsoft make this a default behavior? What’s the downside to this behavior?

    0
    1. Pavel Bludov

      Hi Andy,
      That is a good question. I just like having both options as I can definitely see a use case for both.
      Let’s say you started typing a phone number “312”. It might be a good thing that it filters out right away by its code rather than finding all numbers where 312 is used.

      0
    2. Steve

      If you have a large list of choices, say for a large term set, using the Filter appears to only apply to the first 500 items, so you do not see all options returned when you start typing. This is a great solution, but it slightly limited.

      0
  4. Thacha

    Thank you so much. Very good tutorial.

    0
    1. Pavel Bludov

      Thanks!

      0

Leave a Reply