cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GreenJaguar
Resolver I
Resolver I

setting minimum character number for combo box search

I am working on a people picker using a combobox to search the office 365 users 

Here is my items function

Office365Users.SearchUser({searchTerm:PeoplePicker.SearchText,top:9})

 

I would like for the drop down to begin population once the user types more than 2 characters.  i.e., be blank when sm is typed and then begin to populate when smi is typed.

 

How can this be controlled?

Thx

1 ACCEPTED SOLUTION

Accepted Solutions
GreenJaguar
Resolver I
Resolver I

Thank you @zmorek 

That works.  I also came up with this way

 

If(
     Len(
              PeoplePicker.SearchText)>2,
      Office365Users.SearchUser({searchTerm:PeoplePicker.SearchText,top:9}

   )

)

View solution in original post

2 REPLIES 2
zmorek
Super User
Super User

Edit for formatting because it didn't save correctly...

 

Update your Items property to:

 

 

If(
    Len(Self.SearchText) < 3,
    Blank(),
    Office365Users.SearchUser(
        {
            searchTerm: PeoplePicker.SearchText,
            top: 9
        }
    )
)

 

 

GreenJaguar
Resolver I
Resolver I

Thank you @zmorek 

That works.  I also came up with this way

 

If(
     Len(
              PeoplePicker.SearchText)>2,
      Office365Users.SearchUser({searchTerm:PeoplePicker.SearchText,top:9}

   )

)

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,559)