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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Distinct Filter of Gal...
Power Apps
Answered

Distinct Filter of Gallery

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

How do I get this Distinct filter to work?

If(IsBlank(Event_Registration_Attendee_Name_Input_Fld.Text),Filter(Distinct(Event_Registration_Collection,Client_FullName,SortOrder.Descending,Filter(Distinct(Event_Registration_Collection,StartsWith(Last_Name, Event_Registration_Attendee_Name_Input_Fld.Text)))

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,246 Most Valuable Professional on at

    I don't think there is a way to fix this.  The problem is that Distinct() will return a one column table based on the column you are asking to be Distinct. So the column you want to filter on won't be in the results to be used for filtering.

  • Phineas Profile Picture
    5,331 Moderator on at

    But I can run a distinct filter in the gallery, yes.

    I have an SPList. On that list the individuals name may appear more than once. I only need the individual to appear once in the Right gallery, once selected additional information from the same data source will appear in the Left gallery.

    Phineas_0-1703366672054.png

     

  • Pstork1 Profile Picture
    69,246 Most Valuable Professional on at

    No you can't really use a distinct function in a gallery. Here's a quote from the docutmentation.

     

    "The Distinct function evaluates a formula across each record of a table and returns a one-column table of the results with duplicate values removed. The name of the column is Value."  Distinct function - Power Platform | Microsoft Learn

     

    As I said the output of distinct is a one column table so the other columns aren't there in the results to be used as in the filter()

  • Verified answer
    WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    @Phineas ,

    Firstly set the Default of Event_Registration_Attendee_Name_Input_Fld to "" (empty string) then the left gallery can be (I have only restored the columns I can see in your screenshot and assume you are using SharePoint)

    AddColumns(
     GroupBy(
     Filter(
     Event_Registration_Collection,
     StartsWith(
     Last_Name, 
     Event_Registration_Attendee_Name_Input_Fld.Text
     )
     ),
     "Client_FullName",
     "Grouped"
     ),
     "TicketType",
     First(Grouped).'Ticket Type',
     "UniqueID",
     First(Grouped).'Unique ID",
     "_ID",
     First(Grouped).ID
    )

    then the Item of the Form on the right

    LookUp(
     Event_Registration_Collection,
     ID = Gallery1Name.Selected._ID
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Phineas Profile Picture
    5,331 Moderator on at

    Maaaan, you must have a BIG-O wizard hat!🤣

    Thank you!

    P.S. - Let me know if you find time and have an answer for my camera/attachment/folder sub-folder question.
    My flow using just a local attachment file creates these two folder levels in the Library. This is also what I'd like the ability to do with the other flow. I tried to mimic the formula and merely change to the camera and attachment, that didn't work.

    Phineas_0-1703370551394.pngPhineas_1-1703370623979.png

    Phineas_2-1703370756816.png


    Thanks again!!!

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    @Phineas ,

    I would need to see your other Flow - you need to use Create Folder in it to set up the required structure.

  • Phineas Profile Picture
    5,331 Moderator on at

    Here it all is...

    Below is attachment with file from laptop.

    Phineas_0-1703377817334.png


    Attachment control has 'RegistrantFormImageCollection' in
    the items.

    Error - Trigger schema mismatch. The input body for trigger
    'manual' of type 'Request' did not match its schema definition.
    Invalid type. Expected string but got Null. '."}} 

    Below is attachment with image from Collection created
    by camera control.

    Phineas_1-1703377817343.png


    Camera OnSelect has -
    Set( varName, GUID()
    );
    Collect(
    RegistrantFormImageCollection,
    {
    DisplayName: varName & ".jpg",
    Id: varName & ".jpg",
    Value: NR_Camera_Control_2.Photo
    }
    );

    Button code - UploadEventDocumentsFlow.Run(
    Event_Registration_Document_Type_Dropdown.Selected.Value,TextInput3_31.Text
    &" - "& Event_Registration_Photo_Gallery_Name_Fld.Text,
    { file: {
             contentBytes: First(DataCardValue42_1.Attachments).Value,
             name: Event_Registration_Document_Type_Dropdown.Selected.Value
             &" - "& Event_Registration_Photo_Gallery_Name_Fld.Text
    }
    });

    Power Apps V2 Flow -

    Phineas_2-1703377817365.png

     

     

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    @Phineas ,

    Why are you using the attachment control at all here  - you can just use the collection and if there is only one photo, you do not need the collection as I posted earlier. Also have you addressed the folder issue ?

  • Phineas Profile Picture
    5,331 Moderator on at

    I am using the attachment control because videos and posts use it.

    What do I know.🤣

    There is only one attachment at a time.

    I thought about a gallery, but couldn't figure out how to change the name of the file for each photo taken, using the dropdown that named the photo. In my test all the images in the dropdown had the same 'name', which won't work.

    I have not addressed the folder issue. How should I address the folder issue?

    I thought it was working. The folder is being created. The file is being created. But I can't open the file once it is created.

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    @Phineas ,

    I just ran this test Flow

    WarrenBelz_0-1703385904745.png

    And created a folder with the file successfully filed in it.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard