cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PhilD
Kudo Kingpin
Kudo Kingpin

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

@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!

View solution in original post

11 REPLIES 11
Jeff_Thorpe
Super User
Super User

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.

@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!

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).

 

 

 

 

@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.

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.

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?

ericonline
Community Champion
Community Champion

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

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.

Anonymous
Not applicable

Does anyone know if this was ever fixed? Tried both the original post and the List/Text Input box solution using Microsoft365Users.SearchUserV2({searchTerm:TextInput2.Text}) and neither one worked for me.

 

Thanks!

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (3,548)