cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
subsguts
Continued Contributor
Continued Contributor

SearchUserV2 does NOT work with a ComboBox

This doesn't work if you are using a combobox that allows the user to type in and have name come up.  Today, I use the following:

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

However, changing this to V2, doesn't work at all, it gives garbage entries in the combo box and in addition it doesn't let the user type in the box to find the person they are looking for.  Appreciate help on this as if this the original SearchUser goes away, I will need to completely re-program this to use a text box with some type of lookup, which would be a LOT more effort for something that shouldn't be needed.  Why would they get rid of the ability to use a combobox with SearchUser?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@subsguts 

It works just fine!  

When you change the formula, it needs to change to:

Office365Users.SearchUserV2({searchTerm:self.SearchText}).value

Make sure you have then set the search field (as well as the display field) in your combobox.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@subsguts 

It works just fine!  

When you change the formula, it needs to change to:

Office365Users.SearchUserV2({searchTerm:self.SearchText}).value

Make sure you have then set the search field (as well as the display field) in your combobox.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
subsguts
Continued Contributor
Continued Contributor

Thanks Randy!  This gave me the hints I needed.


For others:  I had to replace "self" with my "cmbRequestor".  Also, PowerApps decided when you change the Items to V2 that it should turn off the "Allow Searching" property of the combo box (I think a bug).  After turning that back on and with the above changes, it is working with V2. 

Thanks again, this should help a lot of folks if they are forced to convert from to V2.  Personally, I don't want to go back and change all my Apps... Wondering if I'll have to some day 🙂

RandyHayes
Super User
Super User

@subsguts 

Ooop - Sorry, I mistyped self...it should have been Self (uppercase S).  Best to use Self and Parent as much as possible to eliminate typing in control names.

 

Yes, comboxes will very often (if not always) turn off the allow searching when you alter the Items property of the control.  Always good to check that and the multiple select properties as they are the ones that change based on the Items.

 

Yes...some day they will retire the, already listed as, deprecated SearchUser action.  If you are not going back to change the past apps, at least make sure you are putting in the new stuff going forward.

 

Glad it was helpful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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 (2,753)