sure @asuhaimi
Ps I will do the comparison with WeekNum and not the startOfWeek variable as previously.
Please consider the following:
- Datasource = yourDataSource {dateStart, dateEnd, weekNumber,etc...}
- Gallery = StandbyList2022
- varWeekNumber
- Button = btnShowCurrentWeek
Add the following:
App.Onstart
//set the current week number to a variable you will use to evaluate which items to show
Set(varWeekNumber,WeekNum(Today()))
StandBy Screen (4 cards screen)
// set the local variable to filter your list when selected, by default it will be false
btnShowCurrentWeek's OnSelect = UpdateContext({FilterTheList:!FilterTheList})
//show the function the button will perform to the user,
//when not clicked (FilterTheList will be false) it will show all items, clicking the button will then "Filter List"
btnShowCurrentWeek's Text = If(FilterTheList,"All","Filter List")
//filter the gallery based on whether the button was clicked
StandbyList2022's Items = If(FilterTheList,Filter(yourDataSource, weekNumber = varWeekNumber),yourDataSource)
//when the user click to filter (FilterTheList is true) then change the background of the template
StandbyList2022's TemplateFill = If(FilterTheList, LimeGreen, RGBA(0, 0, 0, 0))
Hope this will help,
R