cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Priyasantra
Microsoft
Microsoft

How to auto-populate the Manager Details based on the person field

Hi Team, 

 

I have an onboarding application which uses the datasource as sharepoint list. Currently there are 4 person/group field in powerapp. 

 

1. employee details

2. Manager Details

3. Trainer details

4. Process trainer. 

 

As the below screenshot 

Priyasantra_0-1601037034429.png

 Currently all these columns are entered manually. My current requirement is that the Manager feild should be populated automatically based on employe details.

 

For example- If I am the new joiner the moment I select/enter my account/name in the Employee details it should automatically pop up the manager email without needing me to enter the manager details manually. 

 

Currently I have the below connectors as in screenshot

 

 

thanks in advance

 

Regards

Priya

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Priyasantra ,

Do you want to automatically populate a person field(Manager Details) based on selection of another person field(Employee Details)?

Could you tell me whether these two person field allows multiple selections?

I assume that no.

You could set like this:
1)combo box's Items for Employee Details:

Choices(listname.'Employee Details')

2)combo box's Items for Manager Details:

Choices(listname.'Manager Details')

DefaultSelectedItems:

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

this datacard's Update:

managercomboboxname.Selected

 

 

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.

View solution in original post

5 REPLIES 5
Maxwell123
Helper II
Helper II

Hi! I think for the start of your issue this video will be very helpful!

 

Cascading Dropdown (Shane Young)

https://www.youtube.com/watch?v=pkZG2boN7jQ

 

As far as the second part of your question you can set the value to lookup based on the value of the dropdown above. Maybe something like this?

 

If(IsBlank(Lookup(yourdatasource,employeedetailsinsharepoint=employeedetailsinpowerapps,manageremailcolumninsharepoint),manageremailcolumninsharepoint,false)
v-yutliu-msft
Community Support
Community Support

Hi @Priyasantra ,

Do you want to automatically populate a person field(Manager Details) based on selection of another person field(Employee Details)?

Could you tell me whether these two person field allows multiple selections?

I assume that no.

You could set like this:
1)combo box's Items for Employee Details:

Choices(listname.'Employee Details')

2)combo box's Items for Manager Details:

Choices(listname.'Manager Details')

DefaultSelectedItems:

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

this datacard's Update:

managercomboboxname.Selected

 

 

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.
Han_Quin24
Frequent Visitor

Can anyone help me on this issue? I'm trying to get the manager email and display name to populate based off a "Reported By" data card. I used the formula above and made changes specific to my app, however, the manager fields in SP are single line of text instead of a people picker, then I will need to populate the managers boss information. this has been done before using the current list in place, just not sure what I'm doing wrong 

Han_Quin24_0-1658861610859.pngHan_Quin24_1-1658861630629.pngHan_Quin24_2-1658861654802.png

 

@Han_Quin24 Hello, did you ever resolve this? If so, what was your solution? I have a similar requirement and i'm also stuck.

 

Thank you.

this is the only working solution i found on the internet. thank you.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,118)