cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
km2
Helper I
Helper I

Filter PowerApp by [ME]

i am trying to filter my power app so that when a end-user logs in, they only see the items assigned to them.

If tried to set to Onvisible on the main screen to  Set(ThisUser,User().FullName)

 

The on Browse Gallery   Filter([@'Acknowledgement Log'],ThisUser=User().FullName)

 

Doesn't work.

 

This is my data:

snip1.gif

 

1 ACCEPTED SOLUTION

Accepted Solutions
KrishnaV
Super User III
Super User III

Hi @km2,

 

Change the formula as below:

Filter([@'Acknowledgement Log'],varUser.Email = <<sharepointColumnName>>.Email)

 

I am assuming varUser is a variable you are setting at onVisible property of the screen as below:

Set(varUser,User())

 

I hope this resolved your issue if you see any challenge/need further help let me know I am always happy to help.

 

Regards,
Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

17 REPLIES 17
mdevaney
Super User III
Super User III

@km2 

Use this code in your App's OnStart property

Set(varUser,User())

 

Then use this code in your FILTER function for the browse gallery.

Filter([@'Acknowledgement Log'],AssignedTo.Email=varUser.Email)

 

Note1: Always filter based on email since it is a unique identifier.  Full Name can have duplicates.

Note2: Ensure the Assigned field is a Person type column in SharePoint.

 

 

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

KrishnaV
Super User III
Super User III

Hi @km2 ,

 

Change your formal as below:

 

To a gallery:
Filter([@'Acknowledgement Log'],Title=User().FullName) // I am assuming you are populating FullName of the user in Title Field of the list.

if not your filter should be:
Filter([@'Acknowledgement Log'],AssignedTo.Email=User().Email)
if you want to set it to a form you need to ensure that you are getting only one record, so:
First(Filter([@'Acknowledgement Log'],Title=User().FullName))// I am assuming you are populating FullName of the user in Title Field of the list.

if not your filter should be:
Filter([@'Acknowledgement Log'],AssignedTo.Email=User().Email)

 

 

I hope this resolved your issue if you see any challenge let me know I am always happy to help.

 

Regards,

Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

With either one of the suggestions i get a 'delegation warning' now.

KrishnaV
Super User III
Super User III

ok in that case use as below:

Set(varUser,User())
To a gallery:
Filter([@'Acknowledgement Log'],Title=varUser.FullName) // I am assuming you are populating FullName of the user in Title Field of the list.

if not your filter should be:
Filter([@'Acknowledgement Log'],AssignedTo.Email=varUser.Email)

 

I hope this resolved your issue if you see any challenge let me know I am always happy to help.

Regards,

Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
mdevaney
Super User III
Super User III

@km2 

My response should not produce a delegation warning.  Ensure you have set the varUser in OnStart.

 

Are you using Excel?  That can cause the delegation issue.

 

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

one works now without errors.  Next problem, nothing is showing up 🙂  When i use whatever default filters were in there, it showed all of it.

 

Not using excel, using data from a SharePoint List.

KrishnaV
Super User III
Super User III

is it possible to show a sample data on your list (may be you can hide the confidential data) so that I can help you better with the filter.

 

Regards,
Krishna

If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
mdevaney
Super User III
Super User III

@km2 

There is no matching email in your list most likely.

So, im realizing for whatever reason my person/group column 'Assigned To' is not coming into Power apps for use.  Title (which is hidden from the list) snip2.gifalso has the peoples names but that is just a regular text field.  

 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

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 the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (76,717)