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 / Syntax for button that...
Power Apps
Unanswered

Syntax for button that displays hidden records

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, I am building an app that a gallery of records, some of which will be hidden depending on a value in a column in a Sharepoint list. That part is working great (please see below and image attached), however I need to add on functionality that will enable the user to unhide any hidden records by clicking a button, and to have the button toggle off/on if the user clicks again and again. Could you help me get the syntax? Thank you so much


SortByColumns(
Filter(mydatasource,
StartsWith(Title, TextSearchBox1.Text) &&
MatchStatus.Value = "Available"
),
"DATA",
If(SortDescending1, Ascending, Descending)
)

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @alygator ,

    On your button put

    UpdateContext({varShow:!varShow})

    then your Filter

    SortByColumns(
     Filter(
     mydatasource,
     StartsWith(
     Title, 
     TextSearchBox1.Text
     ) &&
     (varShow || MatchStatus.Value = "Available")
     ),
     "DATA",
     If(
     SortDescending1, 
     Ascending, 
     Descending
     )
    )

     

    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.

  • alygator Profile Picture
    Microsoft Employee on at

    Thank you Warren, it looks like I need to tweak something - could you be so kind as to take a look? I attached screenshots.

    • I added the following to Button_View_all and changed "AutoDisableOnSelect" to "false" so the user could toggle the button.

    UpdateContext({varShow:!varShow})

     

    • I also added the following to BrowseGallery1, however the message is "There is an error in this formula." 

    SortByColumns(Filter([@'M365 Executive Engagement Tracker'], StartsWith(Title, TextSearchBox1.Text) && (varShow || MatchStatus.Value = "Available")), "DATA", If(SortDescending1, Descending, Ascending)

  • Verified answer
    WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @alygator ,

    You are missing a closing bracket, but if this is not the issue, try it the "long" way

    SortByColumns(
     Filter(
     [@'M365 Executive Engagement Tracker'], 
     StartsWith(Title,TextSearchBox1.Text) && 
     If(
     varShow,
     true,
     MatchStatus.Value = "Available"
     )
     ), 
     "DATA", 
     If(
     SortDescending1, 
     Descending, 
     Ascending
     )
    )

     

    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.

  • alygator Profile Picture
    Microsoft Employee on at

    Thank you Warren! It works nicely (with the change of "DATA" to "Title"). Very cool

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard