Hi @rahulk37 ,
Do you want to use a button to decide whether filter the table to show last 7 days’ records or the whole table?
If you do, please follow the steps:
1. Set the Button’s OnSelected:
UpdateContext({LastUpdatedIn7:!LastUpdatedIn7})
2. Set the table or gallery’s Items:
SortByColumns(If(LastUpdateIn7, Filter(Table1,Date Value('Last Updated On')>=Today()-7),Table1,) ”Last Updated On”,Descending)
3. Set the Text of the Button(if it is a button rather than an icon):
If(LastUpdatedIn7,”SHOW ALL” , “SHOW LAST 7 DAYS’”)
When the screen shows up, the Button displays “SHOW LAST 7 DAYS’” while the gallery shows all records, once click the button, gallery items turn to records in last 7 days and button text change to “SHOW ALL”
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it more.