Hi there,
I know this question has been posted multiple times, but I just cannot understand how to "ignore" label.value and show all data when button is pressed in order to filter a SP list.
SP list name = [@'Employee Tasks']
Current filter which is working:
SortByColumns((Filter([@'Employee Tasks'], (Manager.Email = varUserEmail && Active.Value = "Active" && Status.Value = cpManagerTaskStatusFilter1.Selected.Value))
), "TaskCategory", If(SortDescending1, Descending, Ascending), "SortByPriority", If(SortDescending1, Descending, Ascending))
And what I'm trying to do is - add Gallery with 4 buttons to add an extra layer of filtering to this
Gallery1.Items = ["All","Cat 1","Cat 2","Cat 3"]
My goal is to filter based on task category which are stored in the SP list, and I have 3 categories ("Cat 1", "Cat 2" and "Cat 3"), but what I don't have is category called = "All", so when I pass the value of "All" to the filter, of course it is not working.
What I want to do is to get something like this, but with the condition if Gallery1.Selected.Value = "All" to get back all data for all 3 categories
SortByColumns((Filter([@'Employee Tasks'], (Manager.Email = varUserEmail && Active.Value = "Active" && Status.Value = cpManagerTaskStatusFilter1.Selected.Value)
&& 'Task Category' = Gallery1.Selected.Value)), "TaskCategory", If(SortDescending1, Descending, Ascending), "SortByPriority", If(SortDescending1, Descending, Ascending))
The syntax should be something like this
If(Gallery1.Selected.Value = "All" ---- return ALL values from sharepoint list "New Employee" // IGNORE Category value)
If(Gallery1.Selected.Value = "Cat 1" -- return values from sharepoint list where 'Task Category' = "Cat 1")
And so on for "Cat 2" and "Cat 3"
Thanks in advance
Solved! Go to Solution.
Hi @AnthonyJrJr ,
Try this format
SortByColumns(
Filter(
[@'Employee Tasks'],
Manager.Email = varUserEmail &&
Active.Value = "Active" &&
Status.Value = cpManagerTaskStatusFilter1.Selected.Value &&
(
Gallery1.Selected.Value = "All" ||
'Task Category' = Gallery1.Selected.Value
)
),
"TaskCategory",
If(
SortDescending1,
Descending,
Ascending
),
"SortByPriority",
If(
SortDescending1,
Descending,
Ascending
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @AnthonyJrJr ,
Try this format
SortByColumns(
Filter(
[@'Employee Tasks'],
Manager.Email = varUserEmail &&
Active.Value = "Active" &&
Status.Value = cpManagerTaskStatusFilter1.Selected.Value &&
(
Gallery1.Selected.Value = "All" ||
'Task Category' = Gallery1.Selected.Value
)
),
"TaskCategory",
If(
SortDescending1,
Descending,
Ascending
),
"SortByPriority",
If(
SortDescending1,
Descending,
Ascending
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
User | Count |
---|---|
262 | |
110 | |
92 | |
55 | |
41 |