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:
i tried both Manager and manager v2 functions.
any idea, what im doing wrong?
if any information missing will provide it gladly.
Hi @dmclaughlin ,
please refer to @v-yutliu-msft answer, it solved it for me, also marked as accepted solution.
hope it will help.
I'm having this same issue. Did you ever get it to work to pull in the manager of someone based on that someone being a person field in the app?
@v-yutliu-msft My field was working properly until recently. I am doing basically the same thing, but I'm getting an error
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & Office365Users.ManagerV2(DataCardValue21.Selected.Email).mail,
Department:"",
DisplayName:Office365Users.ManagerV2(DataCardValue21.Selected.Email).displayName,
Email:Office365Users.ManagerV2(DataCardValue21.Selected.Email).mail,
JobTitle:"",
Picture:""
}
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.
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,
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
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."
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.
in the sharepoint list it is all person fields.
if additional data required, i will be happy to provide.
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."
WarrenBelz
146,552
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional