So please bear with me while I provide some context...
I have a Gallery on a Dashboard page that populates based on a 'type' variable.
Here is a snippet:
If(
type = "All",
Tickets,
If(
type = "Tickets older than 3 days",
Filter(
Tickets,
DateCreated <> datetype && DateCreated <> Text(Today()),
DateCreated <> Text(
DateAdd(
Today(),
-2
)
),
DateCreated <> Text(
DateAdd(
Today(),
-1
)
) || DateClosed <> datetype && DateClosed <> Text(Today()),
DateClosed <> Text(
DateAdd(
Today(),
-2
)
),
DateClosed <> Text(
DateAdd(
Today(),
-1
)
)
),
the Filter repeats for each of the pre-defined filters.
There is a FilterGallery on the Dashboard that the user clicks to set the 'type'.
I would like to add a Filter page where the user can choose values from dropdowns where the dropdowns are populated with distinct values from the Tickets table. Then once they've made their selections, return to the Dashboard showing the correct Tickets.
I know I can use a Gallery to retrieve and display the distinct values in dropdowns like this: Distinct(Tickets,Status). Then I can retrieve the selected value through Dropdown1.Selected.Value and I could use the OnChange property of the Dropdown to set a variable.
What I don't understand is the next few steps.
1. How do I combine multiple selections from individual dropdowns into a single query?
2. How do I modify the TicketGallery on the Dashboard page based on solving number 1?
What I need help with is the design and implementation of the rest of the solution. I know I can
Hi @DCHammer ,
You can condense your query into this and then add the drop-down where shown
With(
{
_Day: Text(Today()),
_Day1: Text(DateAdd( Today(), -1)),
_Day2: Text(DateAdd( Today(), -2))
},
Filter(
Tickets,
(
Len(Dropdown.Selected.Value) = 0 ||
YourFieldName = Dropdown.Selected.Value
) &&
(
type = "All" ||
(
type = "Tickets older than 3 days" &&
DateCreated <> datetype && DateCreated <> _Day && DateCreated <> _Day1 && DateCreated <> _Day2
) ||
(
type <> "Tickets older than 3 days" &&
DateClosed <> datetype && DateCClosed <> _Day && DateClosed <> _Day1 && DateClosed <> _Day2
)
)
)
)
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.
MVP (Business Applications) Visit my blog Practical Power Apps
Hi @DCHammer
Can you provide context on the filters you want to add in addition to type. I have a rough idea of how to accomplish but may need some fixing based on your answer. You can also set global variables from your filter page to clean up your gallery filter instead of referencing each filter dropdown.
Filter(Tickets,
//add your filters based on your drop downs here seperated by commas
//Example If(IsBlank(AgentDropDown.Selected.Name), true, Agent = AgentDropDown.Selected.Name)
Switch( type,
"Tickets older than 3 days",
And(
DateCreated <> datetype && DateCreated <> Text(Today()),
DateCreated <> Text(
DateAdd(
Today(),
-2
)
),
DateCreated <> Text(
DateAdd(
Today(),
-1
)
) || DateClosed <> datetype && DateClosed <> Text(Today()),
DateClosed <> Text(
DateAdd(
Today(),
-2
)
),
DateClosed <> Text(
DateAdd(
Today(),
-1
)
)
),
//add your additional filters here using the same logic as above
"All",
true))
If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.
Thanks!
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional