cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Aumeuncs
Level: Powered On

How to set connected user's manager as default value (item) for a ComboBox ?

Dear Community, 

 

I've created an app from a SP list. 

 

The Person column have generated a ComboBox in the app. 

I want people to choose a manager of the company in that control, not necessarily their manager but the default value must be their own manager.

 

Here is how I've proceeded : 

  • DataSource : Office365 Users
  • Items property : "Office365Users.SearchUser({searchTerm:ComboBox.SearchText})"

--> This works perfectly , people can choose a manager amoung the entire organization. 

 

The problem comes when I try to set the default value of that ComboBox with the manager of the connected user. 

I think the solution should be the "DefaultSelectedItems" property but I'm not really sure.. 

Can you help me with this ?

 

Thanks for your help ! 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to set connected user's manager as default value (item) for a ComboBox ?

HI @Aumeuncs 

 

Can you try to update the defaultselecteditems of the combobox as:
Office365Users.SearchUser({searchTermSmiley Surprisedffice365Users.ManagerV2(User().Email).mail})
 
The defaultselecteditems property should be in the same schema as the Items property.
 
I carried out a test on my side and this works as expected.MicrosoftTeams-image (6).png

 

Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
7 REPLIES 7
RezaDorrani
Level 10

Re: How to set connected user's manager as default value (item) for a ComboBox ?

Hi @Aumeuncs 

 

Yes it should be the "DefaultSelectedItems" property

Did you try setting the defaultselecteditems property

Community Support Team
Community Support Team

Re: How to set connected user's manager as default value (item) for a ComboBox ?

Hi @Aumeuncs ,

Do you want to set a combo box's default item?
Yes, you should set the DefaultSelectedItems property.

Try this formula:   (set the combo box's DefaultSelectedItems property)

Office365Users.ManagerV2(User().Email)

 

Here's a doc about this connector for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-office365-users#...

 

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Aumeuncs
Level: Powered On

Re: How to set connected user's manager as default value (item) for a ComboBox ?

Hi @v-yutliu-msft  , 

 

Thank you, I've tried to set the "DefaultSelectedItems" property with this formula "Office365Users.ManagerV2(User().Email)" but unfortunatly it doesn't work. 


I think the formula is correct as I don't get any error message. 
However the comboBox is still empty as default. 

 

I've read the documentation but I didn't find something to help me.

Have you try to reproduce it by yourself ? 

 

Regards, 

 

 

Community Support Team
Community Support Team

Re: How to set connected user's manager as default value (item) for a ComboBox ?

Hi @Aumeuncs ,

Did you fill your Manager field of your account in Azure Active Directory?

If the Manager field is empty, using this formula will not get value.

 

Here's a similar issue for your reference:

https://powerusers.microsoft.com/t5/General-Discussion/Office-365-Profile-Information-getting-user-m...

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Aumeuncs
Level: Powered On

Re: How to set connected user's manager as default value (item) for a ComboBox ?

Hi @v-yutliu-msft , 

 

The manager field of my account in Azure Active Directory is well completed ! 

 

Regarding the reference issue, here it's different as I don't get any error message ! 

 

Do you have any other solution ? 

 

Thanks

Super User
Super User

Re: How to set connected user's manager as default value (item) for a ComboBox ?

HI @Aumeuncs 

 

Can you try to update the defaultselecteditems of the combobox as:
Office365Users.SearchUser({searchTermSmiley Surprisedffice365Users.ManagerV2(User().Email).mail})
 
The defaultselecteditems property should be in the same schema as the Items property.
 
I carried out a test on my side and this works as expected.MicrosoftTeams-image (6).png

 

Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Aumeuncs
Level: Powered On

Re: How to set connected user's manager as default value (item) for a ComboBox ?

Hi @yashag2255 ,

 

This works perfectly ! Thank you so much Smiley Happy

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 179 members 4,840 guests
Please welcome our newest community members: