cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mmmcoffeegood
Advocate I
Advocate I

PowerApps search and filters

I have a few questions:

 

First: is it possible to point powerapps data to a particular view on a sharepoint list?

 

Second: I am trying to write an expression for my search box/gallery to only show items that are assigned to [Me] (or the person/user logged into the app. is it possible to use sort or filter to accomplish this?

 

Lastly: what is the most resource-efficient way to write a search expression for a larger list. (over 500 items)

 

 

15 REPLIES 15

 

 

To get rid of the delegation warnings create a collection from MRQ //Collections are not subject to delegation limits.

  Make the OnVisible property of your Screen:  ClearCollect(colMRQ,MRQ).  //This creates the collection whenever the screen becomes visible.

  Make the Items property of your gallery: (Filter(Filter(colMRQ,Status<>"Completed"), IsBlank(Assigned_To_1) || Assigned_To_1= User().FullName))  // This filters your new collection by Status first and then filters the result by Assigned_To_1 is blank or Assigned_To_1 is the current user.  You may need to put User().FullName in quotes, I'm not sure about it so try it both ways to see which one works. 

 

I tried to do this in the attached example using a Sharepoint list with >2000 rows. The Items property is shown in the box above the gallery.  It filters a collection called docs that was ClearCollect(docs,Doctors) by whether the Middle initial (MI) is either blank or = "A." and then by Referring="True".

 

I tried to simplify the filter and this worked also: Filter(docs,IsBlank(MI) || MI="A.",Referring="True")

 

 

v-monli-msft
Community Support
Community Support

Hi @mmmcoffeegood,

 

1) If you mean that you want to make the view in SharePoint list shows exactly in PowerApps, then I'm afraid that this cannot be achieved. But you can work with the app from within SharePoint list. 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/customize-list-form

33.PNG

 

2) If you have this assigned to field as a person and group column in SharePoint, then you could set below formula in Items property of the Gallery:

Filter(ListName, PersonColumn.Email=User().Email)

This will filter the gallery with current login user's email in PersonColumn.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

what does the pipe | do? is it interchangeable like a semicolon ;; or , ?

 

Everytime I add a nested function into my filter expression it loses the data connection. 

 

Filter(MRQ, Status.Value <> "Completed")

this works with delegation warnings.

 

syntax

Filter(MRQ, Status<>"Completed", (IsBlank(Assigned_To_1.DisplayName)),Or(Assigned_To_1.DisplayName=User().FullName))

no data connex

Filter(MRQ, Or(Status<>"Completed", IsBlank("Assigned_To_1"), Assigned_To_1.DisplayName = User().FullName))

no data connex

double pipe "||" is a logical or.

View solution in original post

That did it. had to do a bit of finagling to get the syntax to catch, but the double pipes seemed to fix whatever hiccup powerapps wasn't able to resolve.

 

here's my syntaxt for the record! 

Filter(MRQ, Status.Value <> "Completed", Assigned_To_1.Email=User().Email || Assigned_To_1.Email = "")

 

Corrected.

Filter(MRQ, Status.Value <> "Completed", Assigned_To_1.Email=User().Email || IsBlank(Assigned_To_1.DisplayName))

 

moving the completed condition first helped get the filter correct.

Hi @mmmcoffeegood,

 

I am pleased that you got it to finally work.  If you are satisfied with the result, please mark the thread as solved.

View solution in original post

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 Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (3,946)