cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft dinusc
Microsoft

Re: People Picker filter

I can confirm that this function works.

You can retrieve user ids as following:

Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}).Id

You can also use the Lookup in order to retrieve a single user id.

bdc604
Level 8

Re: People Picker filter

The filtering does works as text is typed in, but initially displays the full listing of users.

 

Is there a way to show nothing until text is actually typed in?

 

ComboBox.Items = Office365Users.SearchUser({searchTerm:PplPicker1.SearchText})

 

pplpicker.PNG

 

something like:

If (Not (IsBlank( PplPicker1.SearchText)), Office365Users.SearchUser({searchTerm:PplPicker1.SearchText}))

Microsoft dinusc
Microsoft

Re: People Picker filter

The connector attempts to pull the list of all the users because it does not support delegation. What you suggesated seems like a good workaround: Provide a long and random search text (which will not resolve to any items) if the searchtext is empty or blank.

bdc604
Level 8

Re: People Picker filter

Works like a charm:

 

If (PplPicker1.SearchText<>"", Office365Users.SearchUser({searchTerm:PplPicker1.SearchText}))

PhilD
Level 8

Re: People Picker filter

Well this worked for a while but something is spontaneously wrong again.

 

Items

Office365Users.SearchUser( {searchTerm:ComboBox1.SearchText})

 

Now it is back to flashing the correct result for just a moment when the SearchText is updated then goes back to displaying the whole list. Seriously giving up on PowerApps as it simply takes too much time to run around and fix everything every week or so... have built some interesting apps that could provide value if only they would work more reliably.

 

SQL Server data source...

PhilD
Level 8

Re: People Picker filter

If using a SharePoint list, the combobox for a people field still works. Apparently the problem I'm experiencing only happens when you try to populate the combobox items using the Office 365 SearchUser function. Tested in Chrome & IE.

 

This was working for several months (just enough to get things up and running) and now has spontaneously stopped worked as described in my previous post. Ironically, I was waiting to hear from @v-micsh-msft about the issue with pasting into the rich text box  being corrected, which does seem to work now, but I guess it doesn't matter much now that the whole app is pretty much disabled because a name can't be added.

Highlighted
PhilD
Level 8

Re: People Picker filter

UPDATE

 

I determined that this is only happening when the form is in FormMode.New and is related to the DefaultSelectedItems property.

 

Using a brand new form and controls (to make sure there was not something else impacting it) I progressively updated the properties to match the form with the problem ComboBox and discovered that when any value is in the DefaultSelectedItems property of the combobox, the search fails when in FormMode.New (for some reason it works fine when editing an existing record).

 

Using something conditional like this in the DefaultSelectedItems property seems to provide a solution by preventing this property from being valued when adding a new item. Maybe I missed the memo and this is the way  you need to configure this but I didn't think so.

 

If(Form1.Mode<>FormMode.New,
    [ThisItem.EmployeeDisplayName]
)

Maybe I'm doing something wrong altogether here not sure but perhaps this will help someone else. In any event... It is working!

Helpful resources

Announcements
thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,470)