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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Not able to display th...
Power Apps
Answered

Not able to display the Manager information in a Canvas app

(0) ShareShare
ReportReport
Posted on by 61

Hi all,

 

I am trying to build a form in a canvas app, that is connected to a SharePoint list. I have two fields in my SharePoint List, one is Employee and the other is Manager. I am trying to pick up the Manager from Office365 when an Employee is entered. I search the forums and found the following post by @Brice235i : https://powerusers.microsoft.com/t5/Building-Power-Apps/Auto-populate-person-look-up-as-the-manager-of-a-nominated/m-p/203833#M65466, but it does not seem to be working for me. I can see the displayname and mail of the manager, if I parse it into a text field, but it is just not showing in the combobox. Interestingly, when I use the same code when I customize the app for the same SharePoint list, it works beautifully. Any idea if there is some setting I am missing on the Manager field?

PowerApps Form Image.png
Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @dhruvmathur 

    Put this code in the OnChange property of the Employee ComboBox.

    Set(empManager,Office365Users.ManagerV2(ComboBox_Employee.Selected.mail));

     

    Then use this code in the Default property of the Card for the Manager ComboBox.

    { 
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", 
     Claims: "i:0#.f|membership|" & Lower(empManager.mail), 
     DisplayName: wmpManager.displayName, 
     Email: empManager.mail
    }

     

     ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Verified answer
    Brice235i Profile Picture
    651 on at

    Hello, did you set the variable on App Start?  Click the App icon and for the OnStart action set the following

     

    Set(gvCurrentUser, Office365Users.MyProfileV2()); 
    
    Set(gvCurrentManager, Office365Users.ManagerV2(gvCurrentUser.userPrincipalName)) 

     

     

    Have you set the default form mode as new?

    on the manager datacardvalue on  DefaultSelectedItems (not default) add the following:

     

     

    //Default formula for the data card value
    If(EditForm1.Mode = FormMode.New && Not( gvCurrentManager.userPrincipalName = ""),
    {
    DisplayName: gvCurrentManager.displayName,
    Claims: "i:0#.f|membership|" & gvCurrentManager.userPrincipalName,
    Department:gvCurrentManager.department, 
    Email:gvCurrentManager.mail, 
    JobTitle:gvCurrentManager.jobTitle
    },
    Parent.Default
    )

     

     

     

  • dhruvmathur Profile Picture
    61 on at

    Hi @Brice235i ,

     

    My Default mode was set to Edit. I changed it to New and it worked!! Thank you very much for helping me fix this, had been struggling to figure out why it wasn't working.

  • Brice235i Profile Picture
    651 on at

    Hello, you might want to try another technique too depending on circumstance.  Instead of the if statement on form mode you could try something like the below.  I found the form mode confusing, but it worked so I kept using that technique... however I think this is easier to understand and good for single screen or customised list app.

    //Default formula for the data card value
    If(IsBlank(ThisItem.'Requested By'),
    {
    DisplayName: gvCurrentUser.displayName,
    Claims: "i:0#.f|membership|" & gvCurrentUser.userPrincipalName, 
    Department:gvCurrentUser.department, 
     Email:User().Email, 
     JobTitle:gvCurrentUser.jobTitle
    },
    Parent.Default
    )
    

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard