web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / People picker default ...
Power Apps
Unanswered

People picker default to manager

(0) ShareShare
ReportReport
Posted on by 6

Hi

I have a created a form in PowerApps from a SP list and have added the Office365User data source.

One of the fields is a people picker that currently allows a user to select their manager. I have done this by adding an Item that allows Choices. 

DarrenBroers_0-1672964660570.png

This works fine and allows the user to manually select their manager. 

However i wanted to enhance this to automatically default this field to the user's manager. I have tried many different ways of doing this and cannot seem to get it to work.

Does someone have a way to make this enhancement?

Thanks

Darren

 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    on at

    Hi @DarrenBroers ,

     

    Please set the combo box's DefaultSelected Items property to:

     

    With({Manager:Office365Users.ManagerV2(User().Email)},{
    
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    
     Claims:"i:0#.f|membership|" & Manager.mail,
    
     Department:"",
    
     DisplayName:"",
    
     Email:Manager.mail,
    
     JobTitle:"",
    
     Picture:""
    
     })

     

     

    Best Regards,

    Wearsky

  • DarrenBroers Profile Picture
    6 on at

    Hi Wearsky

    You mention set the combo box's DefaultSelected Items the above, but i dont have a combo box. 

    Does this mean i need to add a combo box into my form somewhere?

     

    Darren

  • v-xiaochen-msft Profile Picture
    on at

    Hi @DarrenBroers ,

     

    Could you please tell me what the control you have for letting users select a manager is?

     

    vxiaochenmsft_0-1672970932607.jpeg

     

    Best Regards,

    Wearsky

  • DarrenBroers Profile Picture
    6 on at

    Hi Wearshy

    Its just a people picker field were the user can search for a person and select their manager. 

    DarrenBroers_0-1672972235438.png

     

    What i would like is for the form to default to the logged in user's manager to appear by default. 

     

    Darren

  • v-xiaochen-msft Profile Picture
    on at

    Hi @DarrenBroers ,

     

    It is  a combo box

    vxiaochenmsft_0-1672973014681.jpeg

     

    Best Regards,

    Wearsky

  • DarrenBroers Profile Picture
    6 on at

    Hi Wearsky

    OK. So if i add your code into the DefaultSelectedItem it accepts it without errors, but when i preview the form the field is not defaulting to my manager.

    DarrenBroers_0-1672973866157.png

    DarrenBroers_1-1672973906446.png

     

    I do still have code in the Item field, but it i remove it, it still does not default to my manager.

    DarrenBroers_2-1672974055119.png

     

     

    Darren

  • AmandaMink Profile Picture
    23 on at

    Hi @DarrenBroers 

     

    I hope you got it working by now, but just wanted to share what worked for me as I experienced the same behavior.

     

    I got it working when I changed "Email" to "ID", see below in red. 

     

    {DisplayName: Office365Users.ManagerV2(varselectedpersonvalue.Id).displayName,
    Claims:"i:0#.f|membership|" & Office365Users.ManagerV2(User().Email).mail,
    Department:"",
    Email: Office365Users.ManagerV2(User().Email).mail,
    JobTitle:"",
    Picture:""}

  • CU22040918-0 Profile Picture
    195 on at

    Hi @DarrenBroers 

     

    The direction is right! 

     

    Try to add DisplayName into code snippet as below since I believe DisplayName is primary field your combobox displaying. If not specified, combo box will show nothing.

     

     

    With({Manager:Office365Users.ManagerV2(User().Email)},{
    
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    
     Claims:"i:0#.f|membership|" & Manager.mail,
    
     Department:"",
    
     DisplayName:Manager.displayName,
    
     Email:Manager.mail,
    
     JobTitle:"",
    
     Picture:""
    
     })

     

    Nelson

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard