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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Auto-populate user man...
Power Apps
Unanswered

Auto-populate user manager's manager field for a selected Person (not current user)

(0) ShareShare
ReportReport
Posted on by 55

I am trying to pre-populate a user manager's manager field in a PowerApps form based on a selection made in a Person field. When the user selects an employee from the People Picker field, the Manager's Manager field should auto-populate with the employee's manager of manager. I used the following formula, but it doesn't show the Manager's manager when a new form is loaded (See picture). The manager's manager doesn't show until I removed the employee's name from the People Picker and add her name back to the People Picker field. What am I missing?

DataCardValue6 is a data card for the employee name field.

 

{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Office365Users.ManagerV2(Office365Users.ManagerV2(DataCardValue6.Selected.Email).mail).mail,
DisplayName: Office365Users.ManagerV2(Office365Users.ManagerV2(Office365Users.UserProfile(DataCardValue6.Selected.Email).UserPrincipalName).userPrincipalName).displayName
}, Parent.Default)

 

Thanks for your help.

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    on at
    Re: Auto-populate user manager's manager field for a selected Person (not current user)

    Hi @YV1 ,

     

    If the form mode is new, does the control 'DataCardValue6' have value?

    Besides, In which property do you use the formula? DefaultSeletedItems or anything else? And could you share the full formula?

     

    Best Regards,

    Wearsky

  • VV-05122257-0 Profile Picture
    55 on at
    Re: Auto-populate user manager's manager field for a selected Person (not current user)

    Hi Wearsky - Yes, "DataCardValue6" have value (pre-populated employee's name) if the form mode is new. Employee/Associate's Name: DataCardValue6 have Default and DefaultSeletedItems properties with a formula below:

     

    If(EntryTypeVar = "New",
    {
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    Claims: "i:0#.f|membership|" & Office365Users.MyProfileV2().userPrincipalName,
    DisplayName: Office365Users.MyProfileV2().displayName
    }
    , Parent.Default)

     

    - The manager's manager (Director/Chief) field have Default and DefaultSeletedItems properties with a formula below:

     

    {
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    Claims: "i:0#.f|membership|" & Office365Users.ManagerV2(Office365Users.ManagerV2(DataCardValue6.Selected.Email).mail).mail,
    DisplayName: Office365Users.ManagerV2(Office365Users.ManagerV2(Office365Users.UserProfile(DataCardValue6.Selected.Email).UserPrincipalName).userPrincipalName).displayName
    }, Parent.Default)

     

    I used the formulas above, but it doesn't show the Manager's manager when a new form is loaded. The manager's manager (Director) doesn't show until I removed the employee's name from Employee's People Picker control and add her name back to the People Picker field. 

     

    Thanks.

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 836 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard