cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Service Desk Example - Filter for TicketsPage

Can someone explain how the TicketsPage shows only the selected records from the HomePage option that was chosen?  On the HomePage I see the OnSelect Action with all the IF statements but I don't understand how the filtering is working.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Service Desk Example - Filter for TicketsPage

On the HomePage, the OnSelect statement you mentioned has a Navigate call for each condition which passes the context to the TicketsPage.

 

The first Navigate call is: Navigate(TicketsPage,ScreenTransition.Fade,{type:"All"}). The context being passed has a property named "type" with the value of "All" and, in the time based cases, an additional property called "datetype" is set respectively based on the condition.

 

On the TicketsPage, the TicketsGallery items is set to:

 

 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="Tickets closed today",Filter(Tickets,datetype in DateClosed),Filter(Tickets,type in Status)))))

 

The first condition, checks if type is "All" then use the Tickets datasource while the following conditions use the Filter formula to limit the datasource items given a condition.

 

See the article on filtering for more information. https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/.

 

Ryan McHenry [MSFT - PowerApps]

View solution in original post

5 REPLIES 5
Highlighted
Power Apps
Power Apps

Re: Service Desk Example - Filter for TicketsPage

On the HomePage, the OnSelect statement you mentioned has a Navigate call for each condition which passes the context to the TicketsPage.

 

The first Navigate call is: Navigate(TicketsPage,ScreenTransition.Fade,{type:"All"}). The context being passed has a property named "type" with the value of "All" and, in the time based cases, an additional property called "datetype" is set respectively based on the condition.

 

On the TicketsPage, the TicketsGallery items is set to:

 

 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="Tickets closed today",Filter(Tickets,datetype in DateClosed),Filter(Tickets,type in Status)))))

 

The first condition, checks if type is "All" then use the Tickets datasource while the following conditions use the Filter formula to limit the datasource items given a condition.

 

See the article on filtering for more information. https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/.

 

Ryan McHenry [MSFT - PowerApps]

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Service Desk Example - Filter for TicketsPage

Thank you so much for the explanation!

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Service Desk Example - Filter for TicketsPage

Good Morning, this post is solved but I have a quick question?

 

If I want to add a new filter, lets say tickets by person how can I achive this?

 

Thanks in advance for your response

 

Capture.JPG

Highlighted
Frequent Visitor

Re: Service Desk Example - Filter for TicketsPage

Hi

Were you able to get this firgured out?  I'm trying to do the same thing?

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Service Desk Example - Filter for TicketsPage

Well I give up trying to change this, what I did instead was to replace the current filters by my own in both the excel file and the filter formula. i.e I've changed "On Hold" -> "Jhon Smith" , "Tickets in Progress" by "Jhon Lenon" etc. BTW case sensitive.

 

Hope this help!

 

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,744)