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

Default filtered gallery view with a drop down filter

Hoping this one is fairly straight forward.

 

I have a gallery view of a sharepoint list of tasks.

Each list item has both a status and a discipline attribute.

I want my powerapp to, by default, show a filtered view of my List, removing all status "Complete" tasks. I also want a drop down filter that my user can select a discipline.

 

I know how to filter a gallery view -> Filter(SPListName,Status.Value = "Assigned")

and

I know how to use a dropdown -> If(Dropdown1.Selected.Result ="All", SPListName, Filter(SPListName, Discipline.Value=Dropdown1.Selected.Result))

 

But I don't know how to use them together. Any help would be very welcome.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @JamesP106 

Please tell me if this is the logic you are after.

Filter(
   SPListName,
   If(
      Dropdown1.Selected.Result ="All",
      Status.Value <> "Assigned", 
      Discipline.Value=Dropdown1.Selected.Result &&
      Status.Value <> "Assigned"
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

8 REPLIES 8
Super User III
Super User III

Hi @JamesP106 

Please tell me if this is the logic you are after.

Filter(
   SPListName,
   If(
      Dropdown1.Selected.Result ="All",
      Status.Value <> "Assigned", 
      Discipline.Value=Dropdown1.Selected.Result &&
      Status.Value <> "Assigned"
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Highlighted

Hi @WarrenBelz

Thanks for your help. That didn't seem to work. I may have confused matters with my examples.

 

My gallery is currently subject to this filter when the Discipline drop down is selected.

If(Dropdown1.Selected.Result ="All", SPListName, Filter(SPListName, Discipline.Value=Dropdown1.Selected.Result))

 But as a default I need the gallery to not include a task which has been marked at "Assigned"

Filter(SPListName,Status.Value <> "Assigned")

I need these two expression joined as one.

 

Highlighted

Solved it.

@WarrenBelz  your approach was on the money just needed the "=" to be "<>" and its running perfectly.

 

Filter(SPListName,If(Dropdown1.Selected.Result ="All", Status.Value <> "Assigned", Discipline.Value=Dropdown1.Selected.Result && Status.Value <> "Assigned"))

 

 

Thanks for your help. If you want to modify your original post I'll mark as the solution.

Highlighted

@JamesP106 ,

Done - I was more focusing on syntax, however you have equals in your post. Never mind fixed now.

Highlighted

@WarrenBelz 

 

Hoping to build on the above solution.

 

I'd like to filter out both "Assigned" AND "Completed" tasks. I've tried a few different options but am not getting far.

 

Any assistance greatly appreciated.

Highlighted

Hi @JamesP106 ,

The below will work, but the not <> filter is not Delegable. What status values are left with these two out? I actually use the same principal on a big list, but filter on the ones I am looking for (not missing) and then it is completely Delegable.

Filter(
   SPListName,
   If(
      Dropdown1.Selected.Result ="All", 
      Status.Value <> "Assigned" && Status.Value <> "Completed", 
      Discipline.Value=Dropdown1.Selected.Result && 
      Status.Value <> "Assigned" && Status.Value <> "Completed"
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted

Thanks @WarrenBelz . 

Delegable is good.

The status values remaining now would be "Open" and "On Hold".

A better approach to my problem is very welcome.

 

Thanks

Highlighted

Thanks @JamesP106 ,

All you need is

Filter(
   SPListName,
   If(
      Dropdown1.Selected.Result ="All", 
      Status.Value = "Open" || Status.Value <> "On Hold", 
      Discipline.Value=Dropdown1.Selected.Result && 
      Status.Value = "Open" || Status.Value <> "On Hold"
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (13,468)