cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
waldarb76
New Member

How do I Filter Lead Gallery from Distinct Gallery - Data is Dynamics 365 Leads

I am new to creating canvas apps and I used DataVerse > Leads to test out a way to create a simple Canvas app used to handle Leads. I am filtering the status field from the Lead entity

 

This is all based on trying to replicate the Service Desk Example that uses Collections vs. a DataVerse > Leads Table. I want to replicate this against the Lead Table in DataVerse. This helps explain how it works in the Service Desk example template. https://powerusers.microsoft.com/t5/Building-Power-Apps/Service-Desk-Example-Filter-for-TicketsPage/...

 

Here is my functional Items formula and in the following screen shots. Distinct(Leads.'Status Reason','Status Reason')

 

I want to click on the > ICON for each Distinct status Reason and have that filter out that STATUS on the below screen. 

2022-02-17_13-50-15.gif

 

I want this screen filtered out based on the selection from the above screen.

2022-02-17_13-50-54.gif

The icon for the HomePage Screen in the service desk example has this code:

 

 

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

 

I tried the following adjustment to the Service Desk Example I wrote about above. I cannot get to work on the tickets page:

 

 

 If(type="All",
     Leads,
If(type="Contacted", 
    Filter(Leads,   createdon <> 'Status Reason' && createdon <>Text(DateValue(Text(Today()), "en")), createdon <> Text(DateAdd(DateValue(Text(Today()), "en"), -2)),createdon <> Text(DateAdd(DateValue(Text(Today()), "en"), -1))|| 'Est. Close Date' <> 'Status Reason' && 'Est. Close Date' <> Text(Today()), 'Est. Close Date' <> Text(DateAdd(DateValue(Text(Today()), "en"), -2)),'Est. Close Date' <> Text(DateAdd(DateValue(Text(Today()), "en"), -1))),
If(type="New",Filter(Leads,'Status Reason' in 'Created On'),
If(type="Canceled",Filter(Leads,'Status Reason' in 'Est. Close Date'),Filter(Leads,type in Status)))))

 

 I appreciate your help, I am new to this and lost so thanks! I hope I have written enough to get some assistance, thanks!

1 REPLY 1
waldarb76
New Member

Anyone have any ideas? even another solutution?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,722)