web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : +1StqvE+R4aQMToqGVV4VG
Power Apps - Building Power Apps
Answered

Distinct Filter and Sort on Gallery

Like (0) ShareShare
ReportReport
Posted on 17 Aug 2017 17:54:40 by 112

Hey all,

 

I am looking to make a Tablet view of the ticket system that I am currently working on at the moment.Capture.PNG

 

As you can see with the image, I have buttons and I have a gallery below the buttons. I have two goals to be accomplished with this.

  1. What I am trying to do is have a gallery or buttons, which ever is easier, to display the status of the tickets. Using the Gallery, do I use:
    distinct(filter(datasource, status))
     

    The buttons are an easy fix since you can just use UpdateCOntext and use a global variable, but they dont look pleasing to the eye vs the gallery. 

  2. The other thing I am trying to get to work is with this selection of the status, in another gallery, I will show the tickets with said selected status. EX I select "in progress tickets", all the in progress tickes will show and vice versa. TicketView is the variable that sets the filter on the gallery.
  3. Filter(Tickets_1,If(TicketView = "Open", show all open tickets, If(TicketView = "In Progress", show all in progress tickets, If(...........))))

Any help would be appriciated. Thank you in advance!

Categories:
  • Community Power Platform Member Profile Picture
    on 18 Aug 2017 at 14:59:52
    Re: Distinct Filter and Sort on Gallery

    Hi @Daemagor

     

    I don't think you can have it in the Gallery to list All Tickets. Maybe have a button next to it which says Show All Tickets

  • Daemagor Profile Picture
    112 on 18 Aug 2017 at 13:58:39
    Re: Distinct Filter and Sort on Gallery

    Thank you so much! I have one last question. If I want to show All Tickets, how would I do that? Since it only shows the values in the datasource. Should I just make shift one using rectangles and a button overlaying it?

  • Verified answer
    Community Power Platform Member Profile Picture
    on 18 Aug 2017 at 13:39:34
    Re: Distinct Filter and Sort on Gallery

    Change Gallery1.Item to

    Distinct(Tickets_1, Status.Value)

    Change the Label to

    ThisItem.Result
  • Daemagor Profile Picture
    112 on 18 Aug 2017 at 13:35:58
    Re: Distinct Filter and Sort on Gallery

    Crap, yeah that would do it. Although its not showing all the status' that are in the Datasource. I have atleast 5 Open TIckets and you only see Completed Capture.PNG

  • Community Power Platform Member Profile Picture
    on 18 Aug 2017 at 13:32:46
    Re: Distinct Filter and Sort on Gallery

    What is the type of Status column in your datasource?

     

    Is it a lookup field?

    If yes try to do this

    ThisItem.Result.Value
  • Daemagor Profile Picture
    112 on 18 Aug 2017 at 13:30:33
    Re: Distinct Filter and Sort on Gallery

    Capture.PNGCapture.PNG

     

  • Community Power Platform Member Profile Picture
    on 18 Aug 2017 at 13:16:58
    Re: Distinct Filter and Sort on Gallery

    Your Gallery.Item is this?

    Distinct(Tickets_1, Status)

    If yes

     

    ThisItem.Result will be the name of the Status

     

    For it to work you have to put it inside Gallery card not outside, if you put outside you get invalid argument type.

     

    Again posting a picture of what you have setup would make it easier to solve

  • Daemagor Profile Picture
    112 on 18 Aug 2017 at 13:12:23
    Re: Distinct Filter and Sort on Gallery

    @Anonymous & @Anonymous,

     

    I want the name not the number, sorry for the confusion. But ThisItem.Result on result is spiting and error that it expects a Text value but the rule produces incompatible record values.

     

    This is inside the gallery too

  • Community Power Platform Member Profile Picture
    on 18 Aug 2017 at 13:09:33
    Re: Distinct Filter and Sort on Gallery

    Well the CountRows function is literally counting how many of said condition you have so that is going to be a number. So if you aren't expecting a number that isn't going to work for you.

  • Community Power Platform Member Profile Picture
    on 18 Aug 2017 at 13:06:57
    Re: Distinct Filter and Sort on Gallery

    Hi @Daemagor

     

    Do you want the name of status or number of how many tickets there are with specific status?

     

    If you want the name just change label.Text to

    ThisItem.Result

    If you want the number of tickets with specific status change label.Text to

    CountRows(Filter(Tickets_1, Status = ThisItem.Result))

     ThisItem.Result only works inside Gallery Card so make sure your label is inside the gallery card otherwise you get an error.

     

    Pictures with what you have would help to solve it faster.

     

    Here is what I mean by inside gallery or outside:

    1.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete