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

Filter by user in powerapp and sharepoint list

Hi there,

 

I have a list on a sharepoint teams site. I have created a powerapp to allow users to view the items in the list and to add new items to the list. I have a search bar with the following :

 

SortByColumns(Filter('My Table',TextSearchBox1.Text in Title),"Title",If(SortDescending1,Descending,Ascending))

 

This is currently working exactly how I need it to, however I want to add an extra filter that will allow users to see all items that were created by them. I have tried several things however they arent working or the search bar stops working.

 

I have a button that users can push and that would toggle the list to show either all items or items created by the user. This will be determined by a column with the name 'ItemCreator' and it is just a standard text box. I do have the default value set as:

 

User().FullName

 

On the button, I have the following under the 'OnSelect' section:

 

UpdateContext({FilterMyInteractions: !FilterMyInteractions})

 

Can I please have some help implementing this so that my search bar will still work?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Filter by user in powerapp and sharepoint list

@Amber_L 

Hi there!  I've got some code you can try.  Give it a shot and let me know.

 

My assumption is you only want to show the current user's records when FilterMyInteractions is True.

 

SortByColumns(
    Filter('My Table',
             TextSearchBox1.Text in Title,
If(FilterMyInteractions,ItemCreator=User().FullName,ItemCreator=ItemCreator) ), "Title", If(SortDescending1,Descending,Ascending) )

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

Re: Filter by user in powerapp and sharepoint list

@Amber_L 

Hi there!  I've got some code you can try.  Give it a shot and let me know.

 

My assumption is you only want to show the current user's records when FilterMyInteractions is True.

 

SortByColumns(
    Filter('My Table',
             TextSearchBox1.Text in Title,
If(FilterMyInteractions,ItemCreator=User().FullName,ItemCreator=ItemCreator) ), "Title", If(SortDescending1,Descending,Ascending) )

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

Highlighted
Helper I
Helper I

Re: Filter by user in powerapp and sharepoint list

That works perfect! I tried that code but I was just placing it in the wrong spot.

Thanks for your help!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

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 designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,836)