Hi @mohamednasr ,
The simplest option is to disregard the buttons and replace them with checkboxes (which you can format like a button).
Then apply the below to the Items property of your Gallery, making explicit reference to each of the Checkbox names:
Filter
(
'Your Data',
(!Checkbox_Finance.Value || Team.Value = "Finance Team")
&& (!Checkbox_Legal.Value || Team.Value = "Legal Team")
&& (!Checkbox_HR.Value || Team.Value = "HR Team")
)
If you must really use buttons, then you could apply your Filter parameters (the Filter function in SharePoint is delegable) directly into a local context variable.
On your “Finance Team” button for example, enter the following onto the OnSelect property:
UpdateContext(
{
varData: Filter(
'Your Data',
Team.Value = "Finance Team"
)
}
)
For another team, use the same principle for a different button:
UpdateContext(
{
varData: Filter(
'Your Data Data',
Team.Value = "Legal"
)
}
)
Create an optional Reset button and add the following onto the OnSelect property:
UpdateContext(
{
varData: 'Your Data'
}
)
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.