Hello, I've finally given up and decided I need help with this issue. This is my first attempt at building an app.
I am hoping to provide users with different filters they can use to filter the gallery. Currently I have six buttons, each of which has the following sort of code for OnSelect -
UpdateContext({varFilterBy:"Overdue"}) , UpdateContext({varFilterBy:"Completed"})
I then have the following code for Items in my Gallery, which works as intended:
If(
varFilterBy = "Completed",
Filter(
'Task Tracker (Testing)',
Completion = 100
),
If(
varFilterBy = "Outstanding",
Filter(
'Task Tracker (Testing)',
Completion < 100
),
If(
varFilterBy = "Overdue",
Filter(
'Task Tracker (Testing)',
And(
DueDate < Today(),
Completion < 100
)
),
If(
varFilterBy = "DueToday",
Filter(
'Task Tracker (Testing)',
And(
DueDate = Today(),
Completion < 100
)
),
If(
varFilterBy = "Upcoming",
Filter(
'Task Tracker (Testing)',
And(
DueDate >= varToday,
DueDate <= varOneWeekFromNow,
Completion < 100
)
),
If(
varFilterBy = "All",
'Task Tracker (Testing)'
))))))
However, I am struggling to add my ComboBox filter to this Items code so that the gallery is filtered by both statements. This is my combobox code, which works on its own:
Filter('Task Tracker (Testing)', Combo_AssignedTo_2.Selected.DisplayName = AssignedTo.DisplayName || Combo_AssignedTo_2.Selected.DisplayName = Blank())
This is the closest I have come to getting it to work, however it involved using a textinput and has delegation warnings which I hope to avoid:
Filter(
'Task Tracker (Testing)',
StartsWith(
AssignedTo.DisplayName,
srch_Search.Text
) && If(
varFilterBy = "Completed",
Completion = 100,
If(
varFilterBy = "Outstanding",
Completion < 100,
If(
varFilterBy = "Overdue",
And(
DueDate < Today(),
Completion < 100
),
If(
varFilterBy = "DueToday",
And(
DueDate = Today(),
Completion < 100
),
If(
varFilterBy = "Upcoming",
And(
DueDate >= varToday,
DueDate <= varOneWeekFromNow,
Completion < 100
),
If(
varFilterBy = "All",
true,
false
)))))))
Any advice would be appreciated as I am sure there must be a more efficient way to do this. Thanks.