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 :
Power Apps - Building Power Apps
Answered

Button Filters Not Resetting

(0) ShareShare
ReportReport
Posted on by

@RandyHayes 

 

Hello Randy,

 

I hope you had a nice weekend. I was working on a Power App over the weekend. The colored status buttons are filters for the gallery on the right when pressed. They are working fine to filter the gallery, but when I click the Reset button, I want them to default to the All Tasks view. All of the other filter controls are resetting fine (search, timeline filter, etc.). I haven't played with button filters before. Can you let me know what to do? My formulas are below the gallery screenshot. I'm using your toggle method. Let me know if there is any additional info you need. Thanks!

 

GallerySS.png

Gallery Items formula:

With(
 {
 galItemsTS: AddColumns(
 Filter(
 'Transfer and Promotion Tasks',
 txtSearchActionTS.Text in 'Action Item',
 'Parent ID' = varRecord.ID && (Status.Value = galStatusFiltersTrans.Selected.Value || galStatusFiltersTrans.Selected.Value = "All"),
 !ckMyTasksTrans.Value || 'Assigned To Email' = varUser.Email
 ),
 "time",
 Timeline
 )
 },
 DropColumns(
 SortByColumns(
 Filter(
 galItemsTS,
 If(
 CountRows(lclFilterTS.time) > 0,
 Timeline in lclFilterTS.time,
 true
 )
 ),
 Coalesce(
 locSortColumn,
 "Title"
 ),
 If(
 locSortAscending,
 Ascending,
 Descending
 )
 ),
 "time"
 )
)

 

tglFilter Default formula (not sure what to add to this). OnChange is set to true.

(!IsBlank(lclFilterTS.time) && CountRows(lclFilterTS.time) > 0) 

 

tglReset OnCheck (not sure what to add to this either). Both the OnSelect and the Default properties are set to varClearFilters.

Reset(cbTimelineFilterTS);
Select(btnApplyFiltersTS);
Reset(tglExpandTrans);
Reset(txtSearchActionTS);
Set(
 varClearFilters,
 false
)

Reset Button OnSelect:

Set(
 varClearFilters,
 true
);
UpdateContext(
 {
 locSortColumn: "Title",
 locSortAscending: true
 }
)

 

Thanks Randy,

Teresa

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at
    Re: Button Filters Not Resetting

    Hi @tagustin ,

     

    Please try and bound the clear filter variable with Gallery Items:

    With(
     {
     galItemsTS: AddColumns(
     Filter(
     'Transfer and Promotion Tasks',
     (txtSearchActionTS.Text in 'Action Item',
     'Parent ID' = varRecord.ID && (Status.Value = galStatusFiltersTrans.Selected.Value || galStatusFiltersTrans.Selected.Value = "All"),
     !ckMyTasksTrans.Value || 'Assigned To Email' = varUser.Email) || varClearFilters
     ),
     "time",
     Timeline
     )
     },
     DropColumns(
     SortByColumns(
     Filter(
     galItemsTS,
     If(
     CountRows(lclFilterTS.time) > 0,
     Timeline in lclFilterTS.time,
     true
     )
     ),
     Coalesce(
     locSortColumn,
     "Title"
     ),
     If(
     locSortAscending,
     Ascending,
     Descending
     )
     ),
     "time"
     )
    )

     

    So when varClearFilters = true, the Filter function will return the whole table as you need.

     

    Best regards,

  • tagustin Profile Picture
    on at
    Re: Button Filters Not Resetting

    @v-jefferni 

     

    Hello,

     

    Thank you for trying to help me out. Unfortunately the upper portion above the DropColumns section is all underlined in red when I plug it in. I'm not sure where the breakdown is occurring, but I lose all results and all of my filter controls show red.

     

    Teresa

  • Verified answer
    v-jefferni Profile Picture
    on at
    Re: Button Filters Not Resetting

    Hi @tagustin ,

     

    I'm so sorry that I have messed the criteria of the Filter function up, please use below instead:

    With(
     {
     galItemsTS: AddColumns(
     Filter(
     'Transfer and Promotion Tasks',
     (txtSearchActionTS.Text in 'Action Item' &&
     'Parent ID' = varRecord.ID && (Status.Value = galStatusFiltersTrans.Selected.Value || galStatusFiltersTrans.Selected.Value = "All") &&
     !ckMyTasksTrans.Value || 'Assigned To Email' = varUser.Email) || varClearFilters
     ),
     "time",
     Timeline
     )
     },
     DropColumns(
     SortByColumns(
     Filter(
     galItemsTS,
     If(
     CountRows(lclFilterTS.time) > 0,
     Timeline in lclFilterTS.time,
     true
     )
     ),
     Coalesce(
     locSortColumn,
     "Title"
     ),
     If(
     locSortAscending,
     Ascending,
     Descending
     )
     ),
     "time"
     )
    )

     

    Best regards,

  • tagustin Profile Picture
    on at
    Re: Button Filters Not Resetting

    @v-jefferni 

     

    Perfect! Thanks for your help! I'm marking this as the solution. Have a great day!

     

    Teresa

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 655 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 391 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 225

Last 30 days Overall leaderboard