How does the search in a dropdown work?

The multidropdown field now has the ability to search for specific items within the list of options. I noticed it's quite fast at finding what I'm looking for even with a list of 1000+ items. I would like to know how the search it's being implemented to achieve this level of performance.

The reason why I'm asking is because I would like to try to implement it inside a custom picker if possible. The implementation I have is the same provided by Appian with a foreach loop and checking every item against the provided search. However this stalls with large amounts of data.

I know I can just replace the picker with the dropdown since it does the search for me and I have done that. But I would still like to know if there is a way to have that nice search inside the picker for future reference.

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I don't assume that they're comparable in terms of performance - a dropdown assumes you're pre-querying all data available, storing all of it in a local variable, and passing it all into the dropdown.  I assume this is why it seems so snappy - it's only doing a text match against local data.  I would hesitate to recommend this approach for most things over a hundred rows or so (maybe up to several hundred), due to lag and memory issues. 

    The custom picker, alternatively, queries (usually) nothing in advance and does your querying for you as you search.  This is obviously going to be slower as you pointed out, but could expand out to basically any number of possible DB entries you're searching from.  Thousands?  Hundreds of thousands?  I would expect it'll gracefully handle anything that would work well with any standard page-size-limited query entity call.

    I agree there are going to be plenty of cases where a custom picker implementation can be replaced with the upgraded dropdowns... but they're definitely completely cross-compatible with each other's various use cases.

  • My picker implementation is using local data. It's not querying the db every time the user types something in. I'm just passing in the set of data to search against and doing the text search

  • 0
    Certified Lead Developer
    in reply to Jose H.

    Then I agree this is a strong candidate for conversion to a dropdown.

Reply Children
No Data