cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

get selected user manager name

Hi,

i have a SPO list in which i hjave two Person fields, in the first field the user should type in a name.

i want the other field to be auytomatically populated with the manager name.

i tried this formula in the item property: 

Office365Users.Manager(DataCardValue10_1.Selected.Email).DisplayName

im getting following error:

Perez_0-1599467235202.png

i tried both Manager and manager v2 functions.

 

any idea, what im doing wrong?

 

if any information missing will provide it gladly.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: get selected user manager name

Hi @Perez ,

Do you mean that you have 4 person fields?

Do you want to automatically populate GL based on selected user for Employee, then automatically populate PM based on selected user for GL (LM-->PM-->GL--> Employee)?
Could you tell me the combo boxes' Items:
Usually, the person field combo box's Items look like this:

Choices(listname.fieldname)

If so, please do not set combo box's DefaultSelectedItems directly about Office365Users.Manager function.

You need to make set combo box's DefaultSelectedItems based on person field's data structure.

Please set combo box's DefaultSelectedItems like this:

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

 

 

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

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: get selected user manager name

@Perez 

Your code is correct.  

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

 

The issue where you are typing it.  Did you notice how the error 'Expected Record Value' appeared?  You must be typing it inside a field that expects a record, not a name. For instance this would produce a record.

 

Office365Users.ManagerV2(DataCardValue10_1.Selected.Email)

 

If you need further help please tell me what type of control is being used and what property you are typing inside.  A screenshot of the app would be super beneficial too.

 

 

---
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."

Highlighted
Helper IV
Helper IV

Re: get selected user manager name

@mdevaney 

thanks for your reply.
my use case is that the user type in the app the employee name and i want the GL, PM and LM, names to be automatically retrieved.

Perez_0-1599489389652.png

in the sharepoint list it is all person fields.

if additional data required, i will be happy to provide.

Highlighted
Super User III
Super User III

Re: get selected user manager name

@Perez 
OK, now that I understand your app I must ask: what field would you like the manager to be in?  I do not know what GL, PM, LM mean.

 

Let's assume you would like the Manager to appear in the PM field.  To do it you would simply include this code in the Default property of the PM Combobox.

Office365Users.ManagerV2(DataCardValue10_1.Selected.Email)

 

---
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." 

Highlighted
Helper IV
Helper IV

Re: get selected user manager name

@mdevaney ,

sorry for the abrevations 🙂

its just Group leader, project manager and line manager, using the formula i want to get the employee manager (GL|) and then the GL manager (PM) and so on, LM-->PM-->GL--> Employee.

 

i tried the formula you suggested, the error was disapeared but the default values are not presented

Perez_0-1599505376110.png

 

Highlighted
Community Support
Community Support

Re: get selected user manager name

Hi @Perez ,

Do you mean that you have 4 person fields?

Do you want to automatically populate GL based on selected user for Employee, then automatically populate PM based on selected user for GL (LM-->PM-->GL--> Employee)?
Could you tell me the combo boxes' Items:
Usually, the person field combo box's Items look like this:

Choices(listname.fieldname)

If so, please do not set combo box's DefaultSelectedItems directly about Office365Users.Manager function.

You need to make set combo box's DefaultSelectedItems based on person field's data structure.

Please set combo box's DefaultSelectedItems like this:

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

 

 

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

Highlighted
Helper IV
Helper IV

Re: get selected user manager name

 @v-yutliu-msft .

thanks a lot for your help it worked well!!!

i defined the GL, PM, and LM as varibles on the onselect of the Employee field and than used your formula in the defaultselecteditems field.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,263)