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
Highlighted
Community Champion
Community Champion

Re: Default filtered gallery view with a drop down filter

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
Highlighted
Community Champion
Community Champion

Re: Default filtered gallery view with a drop down filter

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
Frequent Visitor

Re: Default filtered gallery view with a drop down filter

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
Frequent Visitor

Re: Default filtered gallery view with a drop down filter

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
Community Champion
Community Champion

Re: Default filtered gallery view with a drop down filter

@JamesP106 ,

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

Highlighted
Frequent Visitor

Re: Default filtered gallery view with a drop down filter

@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
Community Champion
Community Champion

Re: Default filtered gallery view with a drop down filter

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
Frequent Visitor

Re: Default filtered gallery view with a drop down filter

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
Community Champion
Community Champion

Re: Default filtered gallery view with a drop down filter

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,417)