cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brice235i
Level 8

Auto-populate person look-up as the manager of a nominated person (not current user)

Hi, I have a PowerApp based on a SharePoint custom list. It contains a person look-up card whereby the form submitter nominates a particular person (Employee).   When this person is entered I would like a separate manager card (person look-up) to automatically populate as this person's manager. 

 

The person is not the current user.  The manager is based on whoever is selected.

The only posts I can find on this topic assume the user is the current user which is not the case for this form.

does anyone know the syntax required in the manager field default setting?  I am connected to Office365Users service...  just can't work out the syntax. Something like: Office365Users.ManagerV2(Employee datacardvalue :User().DisplayName})???

Thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Brice235i
Level 8

Re: Auto-populate person look-up as the manager of a nominated person (not current user)

Hi, I managed to work this out...

NameDatacard  is the person look-up field from who the ancilliary fields are derived.

 

Screen

On Visible

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

NameDatacard

OnChange -

Set(gvCurrentManager, Office365Users.ManagerV2(NameDataCardValue.Selected.Email));Set(varManager,gvCurrentManager)

 

ManagerDatacard

DefaultSelectedItems

{DisplayName: gvCurrentManager.displayName,
Claims: "i:0#.f|membership|" & gvCurrentManager.userPrincipalName}

 

Department

Default

First(Office365Users.SearchUser({searchTerm:NameDataCardValue.SearchText})).Department

 

 

View solution in original post

2 REPLIES 2
Brice235i
Level 8

Re: Auto-populate person look-up as the manager of a nominated person (not current user)

Hi, I managed to work this out...

NameDatacard  is the person look-up field from who the ancilliary fields are derived.

 

Screen

On Visible

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

NameDatacard

OnChange -

Set(gvCurrentManager, Office365Users.ManagerV2(NameDataCardValue.Selected.Email));Set(varManager,gvCurrentManager)

 

ManagerDatacard

DefaultSelectedItems

{DisplayName: gvCurrentManager.displayName,
Claims: "i:0#.f|membership|" & gvCurrentManager.userPrincipalName}

 

Department

Default

First(Office365Users.SearchUser({searchTerm:NameDataCardValue.SearchText})).Department

 

 

View solution in original post

Luka84
Level 8

Re: Auto-populate person look-up as the manager of a nominated person (not current user)

Thanks for posting this information, I was trying to do the same and found it very helpful 😃

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,648)