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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter/Update Gallery ...
Power Apps
Answered

Filter/Update Gallery by Button

(0) ShareShare
ReportReport
Posted on by 34

Hi all,

I´m almost done with my first app, but am struggling with one last thing:

 

i have a gallery in the main-screen using this:

 

SortByColumns(Filter(Antrag, StartsWith(Familienname, SucheFeld1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

near to the gallery i have an icon for Ascend/Descend - Sorting, thats works fine. Also searching for the Name via an input field.

 

What i now need (the last feature) is using a radio-button for filtering this gallery using a boolean-Field in the

data-source named "NeuErstellt" .. so when i toggle the button only those with "true" are shown, untoggled ALL items should be shown.

I tried fiddling around with "updatecontext()" but did not come to a conclusion.

 

maybe somebody can help me with a short "push" ?

 

Kind regards,

Markus

Categories:
I have the same question (0)
  • panand99 Profile Picture
    641 on at

    You can use like this :

     

    if(radio1.selected.value="YourValue",

    SortByColumns(Filter(Antrag, NeuErstellt=true && StartsWith(Familienname, SucheFeld1.Text)), "Title", If(SortDescending1, Descending, Ascending)),

    SortByColumns(Filter(Antrag, StartsWith(Familienname, SucheFeld1.Text)), "Title", If(SortDescending1, Descending, Ascending)))

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @markus_poeschlif your source is SharePoint, be aware that there is currently a bug on boolean fields.

    I have found the workaround for the time being to set my condition to the opposite. 

     

    So an potential formula for you is something like this:

    SortByColumns(

        Filter(

           Filter(AntragStartsWith(Familienname, SucheFeld1.Text)),

           If(Radio1.Selected.Value = "Your Value", NeuErstellt<>false, true)

           ),

        "Title",

         If(SortDescending1, Descending, Ascending))

           

    Note, this is a filter of a filter - perfectly legitimate, but you could also possibly combine the statement.  I put it out in two to show a little clarity of what is going on based on your condition.

  • markus_poeschl Profile Picture
    34 on at

    Dear panand,

     

    thank you , i understand you concept, but when this formula is implemented i adopted it to:

     

    >> Checkbox1 is  Oncheck = "UpdateContext({Check1:true})" and "false" on OnUncheck ...<<

     

     

    If(Check1=true,

    SortByColumns(Filter(Antrag, NeuErstellt=true && StartsWith(Familienname, SucheFeld1.Text)), "Title", If(SortDescending1, Descending, Ascending)),

    SortByColumns(Filter(Antrag, StartsWith(Familienname, SucheFeld1.Text)), "Title", If(SortDescending1, Descending, Ascending)))

     

    But now neither the filter itself, nor the textsearch or the sorting work anymore .. 

     

    Kind regards,

  • Verified answer
    markus_poeschl Profile Picture
    34 on at

    i figured it out now. Here´s my solution:

     

    ------------

    If (Checker1 = 1, (SortByColumns(

    Filter(

    Filter(Antrag, StartsWith(Familienname, SucheFeld1.Text)),

    If(Checker1 = 1, NeuErstellt<>true, false)

    ),

    "Title",

    If(SortDescending1, Descending, Ascending))),

    SortByColumns(Filter(Antrag, StartsWith(Familienname, SucheFeld1.Text)), "Title", If(SortDescending1, Descending, Ascending)))

     

    ------------

     

    So thank you all for the "pushes" in the right direction !

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard