Hi All
I have a Gallery in which i return user names (person /group field) with the formula (ThisItem.person_1.DisplayName) what i would like to do in a label is return the managers name associated with the user display name. I have linked in the Office365 users connector but when i try
If(Label1.Text = Text(Office365Users.UserProfileV2(DisplayName).DisplayName),Office365Users.ManagerV2(DisplayName).displayName,"No Manager Listed")
I get an error in the red text section
Is my logic flawed?
regards Gary
Solved! Go to Solution.
What if you try this for the manager label:
If(IsBlank(Office365Users.ManagerV2(ThisItem.person_1.Email).displayName),"No manager listed",Office365Users.ManagerV2(ThisItem.person_1.Email).displayName)
Office365Users.ManagerV2(ThisItem.person_1.Email).displayName should show the manager of person_1, my question is what kind of column person_1 is? Otherwise it's hard to know.
Hi Gary,
It is a known issue that Office365Users throws a 404 error when a field you're trying to show is empty, see this thread.
It should still work for those entries that have data, but I must admit I'm not exactly sure what you want to accomplish.
Based on your description I did a test and the following works for me:
Gallery: Gallery.Items = Office365Users.SearchUserV2().value
Users displayname: Label1.Text = ThisItem.DisplayName
Manager name: If(IsBlank(Office365Users.ManagerV2(ThisItem.UserPrincipalName).displayName),"No manager listed",Office365Users.ManagerV2(ThisItem.UserPrincipalName).displayName)
@SimonPiquer
Thank you for the response
all i am trying to do is in my Gallery i have a username returned (not the person who is logged in) and i want to return their manager.
I have tried you formula and it returns errors
Gallery items = filter on a collection based on date
Label1 = ThisItem.person_1.Displayname
Label to populate = Label1 .Manager
I have tried your formula and edited it with my fields and i receive and error
Invalid arguments
Regards
GAry
What if you try this for the manager label:
If(IsBlank(Office365Users.ManagerV2(ThisItem.person_1.Email).displayName),"No manager listed",Office365Users.ManagerV2(ThisItem.person_1.Email).displayName)
Office365Users.ManagerV2(ThisItem.person_1.Email).displayName should show the manager of person_1, my question is what kind of column person_1 is? Otherwise it's hard to know.
@SimonPiquer
Hi
the column is a sharepoint person/group column
I return the datat to a Label with ThisItem.person_1.DisplayName
my rationale was compare Label1 againts user profile displayname and return manager if true or "No Manager"
(very frustrating 😞 .) is it my logic?
regards gary
Hi @gazzo1967 ,
This formula is used to : get person_1 field's manager, if he has manager, it will return his manager, if he has no manager, it will return "No manager listed".
If(IsBlank(Office365Users.ManagerV2(ThisItem.person_1.Email).displayName),"No manager listed",Office365Users.ManagerV2(ThisItem.person_1.Email).displayName)
The result that this formula returns will not compare with the value in label1: "ThisItem.person_1.DisplayName".
If you want to compare, please describe the feather that you want in details.
The formula above will indeed return this error "manager does not exists....". However, you do not need to worry about this.
This error will return is because you set the user with no manager in his profile. There's no solution to avoid this error, unless you set every person with manager in this profile.
Actually, I do not think you need to care about this error, it will not affect your app's performance.
Best regards,
Thank you both for the response.
i have now found what the issue was and that is my organisation hasn't populated the manager field 😞
So it will always show no manager and an error
thank you very much for you assistance
Simon i will mark your answer as the solution as yougave me the correct answer first 😛
Gary
User | Count |
---|---|
176 | |
111 | |
86 | |
44 | |
42 |
User | Count |
---|---|
228 | |
116 | |
115 | |
72 | |
67 |