To show records where Location of work is NOT a specific value, you don't set VarFilter to the excluded value, you need a separate variable approach.
The cleanest way for an "Others" button: use a different variable to hold the exclusion list and adjust your gallery formula.
Button OnSelect:
Set(VarFilter, ""); Set(VarExclude, true)
Gallery Items (updated):
With(
{_Data: Filter(Permit_V2,
'Permit Status' = "Approved" || 'Permit Status' = "Extended",
If(VarExclude,
'Location of work' <> "I-Plant",
IsBlank(VarFilter) || 'Location of work' = VarFilter
)
)},
Filter(_Data,
IsBlank(DatePicker1.SelectedDate) || DateValue(Dateofworktobedone) = DatePicker1.SelectedDate
)
)
For your other location buttons (the ones that filter TO a specific value):
Set(VarFilter, "LocationName"); Set(VarExclude, false)
For a button that shows all:
Set(VarFilter, ""); Set(VarExclude, false)
This keeps the same gallery formula but switches between include mode (VarFilter) and exclude mode (VarExclude) depending on which button was pressed.
Best regards,
Valantis ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.
❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).
🏷️ For follow-ups @Valantis.
📝 https://valantisond365.com/ 💼 LinkedIn ▶️ YouTube