cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shamrock
Frequent Visitor

PowerApps FilterGallery doesn't work properly

Hi PowerApps experts,


I am using the Service Desk for the template of my project. Everything works well except the FilterGallery. Every time when I click "Tickets older than 3 days," I am getting some tickets that are just one day old. For example, I created two ticket on 4/17/2018 and they show up as Tickets older than 3 days category on 4/18/2018. I cannot find any problems with the code (see below and attached screenshot) in the screen's OnSelect property. Please advise! Thank you.

 

If(ThisItem.TicketTypes="Tickets older than 3 days",UpdateContext({datetype:Text(DateAdd(Today(), -3)),type:"Tickets older than 3 days"})

 

Thank you!

7 REPLIES 7
v-monli-msft
Community Support
Community Support

Hi @Shamrock,

 

I just created one Service Desk template app and I cannot reproduce your issue so far. I see the ticket list in Tickets older than 3 days Gallery are all older than 3 days tickets. 

Capture.PNG

 

I just added a new ticket and I will check if it will show here tomorrow.

 

But I just checked that the original sample app shows the Item property of this Gallery should be:

 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)))))

Did you customized this app?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-monli-msft,

 

Thanks for getting back to me! It looks like the Service Desk you have is an older version of the Service Desk.  You may need to use the latest one to see what I am seeing now; the newer version uses "UpdateContext" syntax. I don't know whether the older version has the same problem or not.


No, I didn't change any syntax, just the colors. To be sure, I even tested the untouched Service desk and I'm seeing the same problem -- the new ticket showed up in the "Tickets older than 3 days" category after the second day, and it should have been only 1 day old. Below is the syntax I got from the OnSelect property of the FilterGallery. Please let me know if you need more informaion.

 

If(ThisItem.TicketTypes="All tickets",UpdateContext({type:"All"}),If(ThisItem.TicketTypes="New tickets",UpdateContext({type:"New"}),If(ThisItem.TicketTypes="Tickets in progress",UpdateContext({type:"In progress"}),If(ThisItem.TicketTypes="Tickets closed",UpdateContext({type:"Closed"}),If(ThisItem.TicketTypes="Tickets on hold",UpdateContext({type:"On hold"}))))));If(ThisItem.TicketTypes="Tickets older than 3 days",UpdateContext({datetype:Text(DateAdd(Today(), -3)),type:"Tickets older than 3 days"}),If(ThisItem.TicketTypes="Tickets closed today",UpdateContext({datetype:Text(Today()),type:"Tickets closed today"}),If(ThisItem.TicketTypes="Tickets opened today",UpdateContext({datetype:Text(Today()),type:"Tickets opened today"}))))

Sofie_D
Responsive Resident
Responsive Resident

I just made a new Service Desk app and I'm not seeing the same problem, if I make a new ticket it doesn't appear in the older than 3 days list. And it has the same formula as yours.

Maybe try creating a new app and see if the issue persists.

Shamrock
Frequent Visitor

Hi @Sofie_D,

 

Thanks for your reply! You will need to check again tomorrow to simulate the probem I have, though. The problem I have is after the second day when the ticket is one day old. Please check again tomorrow and keep me updated. Thank you so much!!!

mpm
Regular Visitor

You might be able to change your system clock to a date in the future to test.

Sofie_D
Responsive Resident
Responsive Resident

@ShamrockI added one in the excel file on yesterdays date, and you are right it does show up in 'tickets older than 3 days'. So there's a bug in one of the formulas somewhere.

Unbihexium
Helper III
Helper III

Hello


I have or had the same probelm. One day old tickets appears in the "3day old Tiecket" filtering.
As I could not find any solution for this topic I've tried something by my self.

It looks like this is working now with the following settings: dont ask me for details, I dont fully understand this filtering.

FilterGallery - Entry
....
If(ThisItem.TicketTypes="Tickets älter als 3 Tage";
UpdateContext({datetype:Text(DateAdd(Today(); -5));  // <--- changed from 3 to 5
....


TicketsGallery - Entry
....
If(type="Tickets älter als 3 Tage";
Filter(Tickets; DateCreated <> datetype && DateCreated <>Text(Today()-1);  //<--- added  -1 
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)));
...

Can someone confirm that??
Is there another/better solution?

 

regards

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,105)