This is a pretty simple ticket app built using a Powerapps template.
There is a FilterGallery and TicketsGallery on the Dashboard page.
FilterGallery sets the Context variables with:
If(ThisItem.TicketTypes="All tickets",
UpdateContext({type:"All"}),
ThisItem.TicketTypes="New tickets",
UpdateContext({type:"New"}),
ThisItem.TicketTypes="Tickets in progress",
UpdateContext({type:"In progress"}),
ThisItem.TicketTypes="Tickets closed",
UpdateContext({type:"Closed"}),
ThisItem.TicketTypes="Tickets on hold",
UpdateContext({type:"On hold"}),
ThisItem.TicketTypes="Tickets older than 3 days",
UpdateContext({datetype:Text(DateAdd(Today(), -3)),type:"Tickets older than 3 days"}),
ThisItem.TicketTypes="Tickets closed today",
UpdateContext({datetype:Text(Today()),type:"Tickets closed today"}),
ThisItem.TicketTypes="Tickets opened today",
UpdateContext({datetype:Text(Today()),type:"Tickets opened today"}))
And the TicketsGallery displays with:
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))),
If(type="Tickets opened today",Filter(Tickets,datetype in DateCreated),
If(type="High Priority Tickets",Filter(Tickets,Priority = "High"),
If(type="Tickets closed today",Filter(Tickets,datetype in DateClosed),Filter(Tickets,type in Status))))))
But I have two challenges to now overcome that I cannot figure out on my own.
1. I don't understand why the context variable is not showing on the Variables page but seems to be setting correctly. I added a Button to the left of the field that sets MySearchText to the input text and that is working because I can run the app, enter a value, click the button and then when I return to edit mode, I can see the MySearchText value has updated. Note: In order to have "Enter text here" display at page load and disappear OnSelect, MySearchText is set during OnVisible to "Enter text here" and the Default for the InputText control has it's Default set to MySearchText. And the Default changes after clicking my little execute button.
2. Since MySearchText is set, how do I then use the MySearchText string in the Gallery query to collect and display any Tickets where Tickets.Description contains MySearchText.
And thanks everyone for the help.