Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • Verified answer
    markus_poeschl Profile Picture
    34 on at
    Re: Filter/Update Gallery by Button

    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 !

  • markus_poeschl Profile Picture
    34 on at
    Re: Filter/Update Gallery by Button

    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,

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: Filter/Update Gallery by Button

    @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.

  • panand99 Profile Picture
    641 on at
    Re: Filter/Update Gallery by Button

    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)))

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

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!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1