cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Responsive Resident
Responsive Resident

Populate Managers Name from Different People Field - Based on SharePoint List

Hello,

 

I have gone through many references for this request however somehow the solutions are not working in my case.

I am trying to get the managers display name from a different people field as per below snap. But getting error.

Capture.JPG

I tried different combinations however any of it is not working. Below are some of them.

 

1. Office365Users.Manager(Office365Users.MyProfile(DataCardValue1.Selected.Email).DisplayName

2. Office365Users.Manager(Office365Users.MyProfile(DataCardValue1.Selected.ID).DisplayName

3. Office365Users.Manager(User(DataCardValue1).Email).DisplayName

 

etc.

 

Referred the YouTube Link: https://www.youtube.com/watch?v=yuIxzObDa28

 

Can anyone please help how to do that?

 

Regards,

17 REPLIES 17

Sorry my mistake. It is UID so you may please consider Choices([@PhoneList].UID)

Apologies.

@AkshayManke 

That's better...;)

 

So the formula still should be:

Office365Users.ManagerV2(DataCardValue1.Selected.Email).displayName

However, if there is nothing selected, you will get an error on that formula.  However...it should still work if you have a value user selected in the DataCardValue1 control.

 

You could alter the formula to this to try and remove the error

If(!IsBlank(DataCardValue1.Selected.Email), 
    Office365Users.ManagerV2(DataCardValue1.Selected.Email).displayName,
    ""
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Hi @RandyHayes,

 

The formula given below by you just now is worked perfectly. 

If(!IsBlank(DataCardValue1.Selected.Email), Office365Users.ManagerV2(DataCardValue1.Selected.Email).displayName, "" ) 

 

But Surprisingly, the earlier formula also worked (in different Text Input Field) after entering the above formula. I don't know the reason but below one is also working now.

Office365Users.ManagerV2(DataCardValue1.Selected.Email).displayName

 

But anyways, Many thanks for all your help Randy!!

 

Thanks a Lot,

Akshay

 

@AkshayManke 

I am guessing that the reason it is working is because you have something selected in your dropdown.

As I mentioned, the original formula will throw an error if the dropdown is empty.  Once you select a person, it will work properly.

 

Glad you have it working now.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Many Thanks @RandyHayes 😊

How could you solve this? i cannot get the manager's email by this code as well

Office365Users.ManagerV2(DataCardValue1.Selected.Email).DisplayName

 

Responsive Resident
Responsive Resident

Hi @lachx,

 

As @RandyHayes, mentioned, you can refer the below code and can modify your code accordingly.

 

If(!IsBlank(DataCardValue1.Selected.Email),
    Office365Users.ManagerV2(DataCardValue1.Selected.Email).Email,
    ""
)

 

Try to replace the 'DisplayName' with 'Email', as per the above code and see if that works for you.

thank you

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (107,820)