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

PowerApps User ComboBox Default Values

I have a powerapp with the following scenario.

PowerApp label field that contains project manager email, this is populated from an upstream process coming from Dynamics Projects.  

Combox that allows a user to search users within the organization and select multiple users.  My goal is to have this combox always default with two selected values including the email from the project manager field and the currently logged in user.  I have found a variety of posts that always reference sharepoint forms and sharepoint pickers however I am not using Sharepoint in this scenario.

 

The Combox is connected to the data source of Office365Users and configured as seen which allows the search of users and multiple selections.

If(Rule1, Office365Users.SearchUser({searchTerm:SearchUserCombo.SearchText}))

 

It seems that default items in a combox expects records and its not as simple as plugging the value of another text field.

 

There are downstream processes using flow that consumes the selected emails to perform various automations.

 

Any direction on this is greatly appreciated.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: PowerApps User ComboBox Default Values

@Dudditz 

Here's my suggestion for how to setup your ComboBox

DefaultSelectedValues property:

 

[
    Office365Users.MyProfileV2().displayName,
    Office365Users.Manager(Office365Users.MyProfileV2().id).DisplayName
]

 

DisplayFields property:

 

["DisplayName"]

 

SearchFields property:

 

["DisplayName"]

 

Items Property (make sure ComboBox1 is changed to your control name):

 

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

 

I've tested the solution on my side and it appears to work.

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

SaWu
Level 8

Re: PowerApps User ComboBox Default Values

Hi @Dudditz 

I didn't understand all of your post and I think there is some confusion with mixing up the default selected values and the Search Functionality.

On my side, I could get a ComboBox to work with Items

Office365Users.SearchUser({searchTerm: ""})

which is an empty Search yielding all users.
Thus, the ComboBox itself can choose any user, and you use the inherent ComboBox Search functionality to limit the number of displayed users.
image.png
As I see it, there isn't any point to using an extra TextInput control for Searching Users.
I have DisplayFields and SearchFields set to

["DisplayName"]

with DisplayName basically being the Fullname, which is thus used for display and for Search with the ComboBox.
To get the two pre-selected items I have DefaultSelectedItems set to

Table(Office365Users.MyProfile(), Office365Users.UserProfile("test@businesstobusiness.onmicrosoft.com"))

which is a table of the current user and the user specified with the test@... email.
In my test CRM those users two have Fullname "Christian Götz" and "Teo Test".
image.pngimage.pngimage.pngimage.png

Best of regards and luck,
    Sa.

View solution in original post

3 REPLIES 3
Super User
Super User

Re: PowerApps User ComboBox Default Values

@Dudditz 

Here's my suggestion for how to setup your ComboBox

DefaultSelectedValues property:

 

[
    Office365Users.MyProfileV2().displayName,
    Office365Users.Manager(Office365Users.MyProfileV2().id).DisplayName
]

 

DisplayFields property:

 

["DisplayName"]

 

SearchFields property:

 

["DisplayName"]

 

Items Property (make sure ComboBox1 is changed to your control name):

 

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

 

I've tested the solution on my side and it appears to work.

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

SaWu
Level 8

Re: PowerApps User ComboBox Default Values

Hi @Dudditz 

I didn't understand all of your post and I think there is some confusion with mixing up the default selected values and the Search Functionality.

On my side, I could get a ComboBox to work with Items

Office365Users.SearchUser({searchTerm: ""})

which is an empty Search yielding all users.
Thus, the ComboBox itself can choose any user, and you use the inherent ComboBox Search functionality to limit the number of displayed users.
image.png
As I see it, there isn't any point to using an extra TextInput control for Searching Users.
I have DisplayFields and SearchFields set to

["DisplayName"]

with DisplayName basically being the Fullname, which is thus used for display and for Search with the ComboBox.
To get the two pre-selected items I have DefaultSelectedItems set to

Table(Office365Users.MyProfile(), Office365Users.UserProfile("test@businesstobusiness.onmicrosoft.com"))

which is a table of the current user and the user specified with the test@... email.
In my test CRM those users two have Fullname "Christian Götz" and "Teo Test".
image.pngimage.pngimage.pngimage.png

Best of regards and luck,
    Sa.

View solution in original post

Dudditz
Level 8

Re: PowerApps User ComboBox Default Values

Thank you both for your responses.  I was able to get this working using your reccomendations.

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,627)