Hello everyone!
We would like to filter the data from our SharePoint list 'Travel Request' on the traveler (being the current user of the PowerApps).
E.g. Request 1:
Traveler: John Doe
Destination: New York
When the PowerApps User is Jane, she can not see this request in the BrowseGallery.
When it's John Doe, he can see his request.
Thanks in advance!
Solved! Go to Solution.
How may travel requests are there? over 500? If so, delegation might be what is causing this issue.
To workaround this, please do the following:
1. Screen.OnVisible = UpdateContext({UserEmail: User().Email})
you could also do Screen.OnVisible = UpdateContext({UserName: User().FullName}) though i recommend Email as that is guaranteed to be unique.
2.
Filter('Travel Request', Traveler.Email = UserEmail)
I assume Traveler is a Person type in SharePoint.
I am also seeing some error icons in the screenshot you posted. Are you sure there is nothing else wrong?
Let us know if this worked.
Thanks
Murali
Hi. Try this:
Filter('Travel Request', User().Email=Traveler.Email)
Please let me know if it works.
How may travel requests are there? over 500? If so, delegation might be what is causing this issue.
To workaround this, please do the following:
1. Screen.OnVisible = UpdateContext({UserEmail: User().Email})
you could also do Screen.OnVisible = UpdateContext({UserName: User().FullName}) though i recommend Email as that is guaranteed to be unique.
2.
Filter('Travel Request', Traveler.Email = UserEmail)
I assume Traveler is a Person type in SharePoint.
I am also seeing some error icons in the screenshot you posted. Are you sure there is nothing else wrong?
Let us know if this worked.
Thanks
Murali
Hi murali
Sorry for the delay.
Well my problem is that i can't type in comma's in that particular screen.
Maybe that is my problem, but i don't know how to fix it and if it could get fixed maybe your solution will work.
And yes Traveler is indeed a person.
Thanks in advance
Tom Slosse
The list separator is based on your locale settings. Try using ; instead and also check in your regional settings. For instance, it's , for me.
Hi, above does work although:
- when saving the current users email to the variable it saves it without capitals. (example: "de.weerdt.johan@xxx")
- when trying to apply the filter on the Person-field as described by @murali, it only works when I manually use the text "De.Weerdt.Johan@xxx" --> see capitals. How to handle this?
Hi @johandeweerdt, there is a simple solution using the Lower function.
I knew that PowerApps was case-sensitive but I didn't realise that this extended to string comparisons, thanks for making me notice that. I will be more careful in future.
Try this:
Filter('Travel Request', Lower(Traveler.Email) = Lower(UserEmail))
Please let me know if this does not work, as there may be issues related to the delegation of the Lower function.
Please see the screenshots below for demo.
thanks for the quick reply. Altough this does solve this particular issue, I'm still a bit worried about the fact that we try to compare the exact same object (email of a 'person') where the first version (= Person.Email coming from Person field of the SharePoint list) is in capitals and the other (=Email of Current User) is not in capitals?
Both are the same 'Person' in active directory and thus the same email?
You are welcome.
Emails are not case sensitive, so the issue you raise does not worry me too much.
The difference could be that athough both come from active directory (I guess, but I am not an expert) one comes from the SharePoint instance, while the other comes from the Office365 instance, and one or the other could eliminate the un-necessary capitalisation of emails when synchronising with active directory.
This is all wild speculation as I am not an expert.
Anyway, glad to be able to help.
I have the same value for Screen.OnVisible
For Filter('Sharepoint List', Author.Email = UserEmail , the ".Email" is being highlighted for service limitations. Are there service limitations for " || " or operator in a gallery.items filter?
User | Count |
---|---|
137 | |
127 | |
75 | |
72 | |
69 |
User | Count |
---|---|
220 | |
135 | |
78 | |
58 | |
54 |