PowerApps – enhance Combo Box search functionality

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

This Post Has 13 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.)

    1. Pavel Bludov

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

  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 🙂

    1. Pavel Bludov

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

  3. Andy

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

    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.

    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.

  4. Thacha

    Thank you so much. Very good tutorial.

    1. Pavel Bludov

      Thanks!

  5. Mondo

    Hi, thanks for this – very useful and I agree it’s baffling that this isn’t available out of the box. Oddly though, although it works flawlessly for me in the PA preview, when I publish to the SP list it stops working. I only have a dozen items in there at the moment, so it’s not a filter limitation – any ideas?

    1. Pavel Bludov

      Hi Mondo,
      I’ve never experienced that behavior. With old MS InfoPath, yes, but not with PowerApps. Are you using a PowerApps form or app?
      Thanks!

  6. Andy

    Super helpfull spend hours to look for this

    1. Pavel Bludov

      Hi Andy,
      Glad it was helpful and thanks for stopping by!

Leave a Reply