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

Notifications

Announcements

Community site session details

Community site session details

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

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,297 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard