cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
finnt
Frequent Visitor

Sharepoint Views

Can anyone please help with filering a powerapp list to display a certain sharepoint view?

 

Help appreciated...

5 REPLIES 5
Perumal Continued Contributor
Continued Contributor

Re: Sharepoint Views

Can you elaborate your requirement? I am unable to understand. Are you trying to filter the powerapps related to a particular SharePoint list?. Today in PowerApps, this feature is not available, but I think in the SharePoint List Modern View this is available. Please check the SPO.

finnt
Frequent Visitor

Re: Sharepoint Views

Hi there and thanks for your reply.

 

In short I have a modern list that I have created a Power App for and am completly happy with everthing except "filtering the list".

 

By this I mean it is a time reporting app for the guys on site to report activity.

All I want to change is the list that each individual sees when they use the app.

I would like this to just be their own returns not the entire teams.

Perhaps a filter that just shows items created by them?

Perhaps a filter that just display items with thir own names in the NAME field?

 

Appreciate any help as I am really keen to use this software but only capable of doing the basics!


Thanks again.

Meneghino Community Champion
Community Champion

Re: Sharepoint Views

Hi.  You need to do the following:

 

  1. Confirm that the list is being shown in a gallery
  2. Find the gallery's Items property
  3. Add a Filter function around the existing items property and use the User() function to get the current user's email or display name, something like this:
MyGallery.Items = Filter ( Whatever is in the Items property now,  NAME = User().FullName)

Please let me know which step you need further help with, or if it is not working.

finnt
Frequent Visitor

Re: Sharepoint Views

thanks for the help.

 

By default powerapps has created the following in the Items box.

 

SortByColumns(Search('Time Reporting', TextSearchBox1.Text, "Description"), "ID", If(SortDescending1, Descending, Ascending))

 

Would you be able to please let me know where to insert the function text you have suggested below?

 

No matter how I try I just dont know and get errors!

 

Appreciated again.

Meneghino Community Champion
Community Champion

Re: Sharepoint Views

OK, now that you have found the right gallery property, you are half way there.

This will work if your table 'Time Reporting' has a column with the name of the site worker, either explicitly as a stand-alone column or you can use the created by or modified by columns for example as you already suggest.

If this is the case, then I need to know a few things is order to be specific with the help:

  1. Which column do you want to use to identify the site worker?
  2. What is the name of this column? (assume it is MyPersonColumn for now)
  3. What data does this column contain when seen from PowerApps? (i.e. a text of the name, a text of the email, or an integer ID or a GUID?) (you may need to create a text box in PowerApps and set its Text property to First('Time Reporting').MyPersonColumn in order to be sure)
  4. When you create a text box in your app and set its Text property to User().FullName, does it properly show your name?
  5. Is the data in 3 and what you get in 4 exactly the same?

If the answer to 5 is yes, then the answer is simply this:

 

Gallery1.Items = Filter ( SortByColumns(Search('Time Reporting', TextSearchBox1.Text, "Description"), "ID", If(SortDescending1, Descending, Ascending)) , MyPersonColumn = User().FullName)

If the answer to 5 is no, then I need to know one more thing: is your SharePoint on-line (Office365 plan) or on-premise?

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

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