cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PhilD
Level 8

Office365Users.SearchUser() in combobox not working

I'm confused about what seems like something simple... hoping an expert can lend a hand.

 

In a combobox, why does this work...

Office365Users.SearchUser({searchTerm : "Phil"})

But this does not...

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

In the first example, the combobox returns all the choices from my organization having "Phil" in the DisplayName. Great, now I should be able to swap out the hard-coded text with input from the SearchText of the combobox.

 

Not so fast, In the second example, with no other changes except what is shown in red, typing "Phil" (or anything else) into the search of the combobox returns nothing. The dots march accross the top, as if a search is taking place, but no results are returned for any text.

 

Data is set to single with DisplayName as primary text and search text (in the data properties pane).

 

I have tried every possible combination of things and can't seem to achieve a simple combobox that searches the Office365Users connection, returns a person so I can then assign to a field (in SQL server data source)  :-(

1 ACCEPTED SOLUTION

Accepted Solutions
PhilD
Level 8

Re: Office365Users.SearchUser() in combobox not working

@Jeff_Thorpe Evidently that was the one thing I didn't try ;-)  Thanks!

 

Not quite as good as having the search performed right in the combobox but this works and took all of about 30 seconds to do... Still not sure why my original method doesn't work but this allows me to move forward.

 

I recently switched over from SharePoint lists to SQL server as my datasource so I didn't have to do this manually before. The performance and flexibility gains are well worth it though...

 

Thanks again Jeff for coming to the rescue!

8 REPLIES 8
Super User
Super User

Re: Office365Users.SearchUser() in combobox not working

Try using a text input box  and a list box. Then set the List Box Items property to the formula below and the Value property to DisplayName:

 

Office365Users.SearchUser({searchTerm:TextInput.Text})

When the user types into the text input box the list box should show a list of user display names filter by the text input box.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
PhilD
Level 8

Re: Office365Users.SearchUser() in combobox not working

@Jeff_Thorpe Evidently that was the one thing I didn't try ;-)  Thanks!

 

Not quite as good as having the search performed right in the combobox but this works and took all of about 30 seconds to do... Still not sure why my original method doesn't work but this allows me to move forward.

 

I recently switched over from SharePoint lists to SQL server as my datasource so I didn't have to do this manually before. The performance and flexibility gains are well worth it though...

 

Thanks again Jeff for coming to the rescue!

PhilD
Level 8

Re: Office365Users.SearchUser() in combobox not working

I think the combobox option should work as it was originally stated. The combobox not being able to search Office 365 users appears to be a bug as another user has pointed out.

 

See this thread .

 

I knew this was working fine before... I thought I was going crazy but it turns out maybe not (yet).

 

 

 

 

Super User
Super User

Re: Office365Users.SearchUser() in combobox not working

@PhilD,

 

I read another post where they mention the "ComboBox1.Items = Office365Users.SearchUser({searchTerm: ComboBox1.SearchText})" feature won't be available until late April. Hopefully the feature will be coming or fixed soon.

 

https://powerusers.microsoft.com/t5/General-Discussion/People-Picker-filter/m-p/102787#M37823



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
PhilD
Level 8

Re: Office365Users.SearchUser() in combobox not working

Thanks @Jeff_Thorpe

 

I agree and hope this is a priority.

 

The pattern of development that we are exploring includes a combination of PowerApps front-end, SQL Server back-end and Qlik as organizational-level analytics (already in use in enterprise). This seems to have tremendous potential to organize 'middle tier' type work, things that may be a bit more than a SharePoint list/library can organized but not at the level of an enterprise software application.

 

There are some areas where PowerApps remains immature (or perhaps my abilities are lacking) but it appears things are heading in the right direction given the support for SQL views, etc.

 

This feature is a must have as it is simply to clunky to "build" a people picker from everywhere you need to get a person ID into a field in a table.

LozzieD
Level: Powered On

Re: Office365Users.SearchUser() in combobox not working

The combobox "direct" approach  ( Office365Users.SearchUser({searchTerm: ComboBox.SearchText} ) was working for me (and this is now October 2018), and just this morning it stopped working - no items being listed.  A regression bug?

Highlighted
Super User
Super User

Re: Office365Users.SearchUser() in combobox not working

I second that. This is a very useful function that IS currently working in production apps, but NOT working in a new app under development. 

 

Anyone have insights?


Thank you

Super User
Super User

Re: Office365Users.SearchUser() in combobox not working

Hm. Ok, well figured this out. 

1. Set the combobox Items Property to: Office365Users.SearchUser({searchTerm:combobox.SearchText})

2. Set the combobox SearchFields Property to: ["DisplayName"] (or whichever of the fields or combination of fields you wish to Search On.

3. Set the combobox DisplayFields Property to: ["DisplayName"] (or whichever of the fields or combination of fields you wish to Disply when a user searches.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 146 members 4,268 guests
Recent signins:
Please welcome our newest community members: