Hello All, @RandyHayes
I am trying to filter a gallery items based on login user.
I have 2 "Person or Group" fields (Employee & Hirining Manager) from the SharePoint list.
so i would like to see all items where my name is in the hiring manager field or if my name is in the Employee field.
I used the following formula but it's very very slow loading the items.. any ideas please?
Filter(
'NAEOOP Master List',
Or(
'Hiring Manager'.Email = Office365Users.MyProfile().Mail,
'Employee (AD)'.Email = Office365Users.MyProfile().Mail
)
)
I tried as well to use the following filter but it's not working:
Filter(
'NAEOOP Master List',
Or(
'Hiring Manager'.Email = User().Email,
'Employee (AD)'.Email = User().Email
)
)
Note: the following will return from my Organization:
Office365Users.MyProfile().Mail => firstname.lastname@company.com
User().Email => Username@company.com
Thanks for your help!
Solved! Go to Solution.
Seems unusual that you would be seeing two different email addresses from those functions unless there are multiple aliases assigned to the user.
But at any rate...you really don't want to put those functions in a formula like that as they will slow things down.
Consider putting the correctly returning value in a variable and use that instead - this is usually done in the OnStart of the App as an easy place to do this.
Set(MyProfileEmail, Office365Users.MyProfile().Mail)
Then in your Filter:
Filter( 'NAEOOP Master List', Or( 'Hiring Manager'.Email = MyProfileEmail, 'Employee (AD)'.Email = MyProfileEmail ) )
I hope that is helpful for you.
Seems unusual that you would be seeing two different email addresses from those functions unless there are multiple aliases assigned to the user.
But at any rate...you really don't want to put those functions in a formula like that as they will slow things down.
Consider putting the correctly returning value in a variable and use that instead - this is usually done in the OnStart of the App as an easy place to do this.
Set(MyProfileEmail, Office365Users.MyProfile().Mail)
Then in your Filter:
Filter( 'NAEOOP Master List', Or( 'Hiring Manager'.Email = MyProfileEmail, 'Employee (AD)'.Email = MyProfileEmail ) )
I hope that is helpful for you.
@RandyHayes Thanks a LOT!!
Yes, it works very well !! i really appriciate your quick help.
Excellent!
User | Count |
---|---|
262 | |
110 | |
98 | |
54 | |
39 |