web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : Ba3879Fg7yxMp3vcfwbJ46
Power Apps - Building Power Apps
Answered

power apps gallery with multiple filters

Like (0) ShareShare
ReportReport
Posted on 30 Nov 2022 14:47:09 by

Hello everyone.  I apologize if this is a rudimentary question, but I am learning power apps and I am new to the filter coding.  I have a power app that has a gallery that is linked to a SharePoint site.  I have two filters for the gallery that, separately work great (thanks @RezaDorrani).  My issue is that I need both to work together on the same gallery, but I am not sure how to combine them to do so. 

 

First code filters the gallery based on the tab selected, the signed in user and the status: 

 

If(vartabselected=1,'SP LIST NAME',vartabselected=2,Filter('SP LIST NAME',User().Email in 'Assigned To'.Email),Filter('SP LIST NAME',User().Email in 'Assigned To'.Email,Progress.Value="Pending"))

 

The second filters the gallery based on the specific selections:

 

SortByColumns(Filter('SP LIST NAME',('Due date' >= cldStart.SelectedDate && 'Due date' <= cldEnd.SelectedDate || cldStart.SelectedDate = Blank() && cldEnd.SelectedDate = Blank()) && (Progress.Value = StatusRadio.Selected.Value || StatusRadio.Selected.Value = Blank()) && (Priority.Value = PriorityRadio.Selected.Value || PriorityRadio.Selected.Value = Blank())
),"DueDate",Descending)

 

I realize the delegation issues and that is okay.  Any assistance you can provide would be greatly appreciated.

 

Thanks

Categories:
  • Community Power Platform Member Profile Picture
    on 03 Jan 2023 at 22:41:40
    Re: power apps gallery with multiple filters

    Drrickryp,

     

    The filter noted in the top portion works great for the main vartabselected=1 which shows all of the tasks.  How can I make the filters work under the remaining gallery tabs.  This is how the gallery is filtered under the current tab structure. 

     

    varTabSelected=1: all tasks 

    varTabSelected=2: tasks assigned to me

    varTabSelected=3: tasks pending my review

    varTabSelected=4: tasks created by me

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 30 Nov 2022 at 16:01:38
    Re: power apps gallery with multiple filters

    Smilegif.gif

     

  • Community Power Platform Member Profile Picture
    on 30 Nov 2022 at 15:50:41
    Re: power apps gallery with multiple filters

    Awesome.  I appreciate the explanation

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 30 Nov 2022 at 15:45:50
    Re: power apps gallery with multiple filters

    @Anonymous 

    Sure, the way I used the With() was to create a temporary collection that is the alias for your first formula.  I then simply  inserted it into the second formula.   The beauty of the With() function is that the collection only exists while the function is running.  It is very efficient and I use it all the time, to simplify complicated formulas such as the one you created.  Shane Young has a nice video to show other uses for it.  https://www.youtube.com/watch?v=AYD2oWue7fw  

  • Community Power Platform Member Profile Picture
    on 30 Nov 2022 at 15:30:46
    Re: power apps gallery with multiple filters

    Thanks Drrickryp.  That worked perfectly. Never would have thought of With{_items:.  I was trying every way I thought I knew how it might go together, but it was pretty far outside my depth of knowledge. If you have a second can you give a quick explanation on how the With Items works.  The rest of the code makes sense to me, but I am not sure how that tied it together.  Thanks so much for the help.  

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on 30 Nov 2022 at 15:17:47
    Re: power apps gallery with multiple filters

    @Anonymous 

    With({_items:SortByColumns(Filter('SP LIST NAME',('Due date' >= cldStart.SelectedDate && 'Due date' <= cldEnd.SelectedDate || cldStart.SelectedDate = Blank() && cldEnd.SelectedDate = Blank()) && (Progress.Value = StatusRadio.Selected.Value || StatusRadio.Selected.Value = Blank()) && (Priority.Value = PriorityRadio.Selected.Value || PriorityRadio.Selected.Value = Blank())
    ),"DueDate",Descending)}, 
     If(vartabselected=1,_items,vartabselected=2,Filter('SP LIST NAME',User().Email in 'Assigned To'.Email),Filter(_items,User().Email in 'Assigned To'.Email,Progress.Value="Pending"))
    )
    

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete