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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Remove Duplicate Rows ...
Power Apps
Answered

Remove Duplicate Rows Based on a Single Column for a Gallery

(0) ShareShare
ReportReport
Posted on by 16

Hi Power Community - I've done a lot of searching and I'm close to my solution, but I need your help to remove duplicate values.  Here's my current code, which is in the items property of a gallery:

 

Sort(Filter(Search(Cards, SearchInput1.Text, "crd23_card", "crd23_card","crd23_controltype","crd23_data","crd23_displaytext"), ControlType = "Button"), DisplayText)

 

This allows a user to search for a value, and it filters to the rows I want (buttons only). It also sorts it alphabetically.

 

The problem is that I have a lot of duplicate values. I want to remove duplicates based on one column only (the column is called DisplayText), but every combination I use either removes duplicates based on all columns (e.g., using the ForAll command) OR it only returns one column (e.g., the Distinct command).

 

Can someone help me put this last step together? Thanks!

I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @Ephezius - use GroupBy to remove duplicates. Note this function is not delegable.

     

    With(
     {
     _grouped_data: DropColumns(
     AddColumns(
     GroupBy(
     Cards,
     "DisplayText",
     "GroupedItems"
     ),
     "Card",
     First(GroupedItems).crd23_card,
     "Control Type",
     First(GroupedItems).crd23_controltype,
     "data",
     First(GroupedItems).crd23_data
     ),
     "GroupedItems"
     )
     },
     Sort(
     Filter(
     Search(
     _grouped_data,
     SearchInput1.Text,
     "Card",
     "Control Type",
     "data"
     ),
     ControlType = "Button"
     ),
     Nominee,
     SortOrder.Ascending
     )
    )

     

  • Ephezius Profile Picture
    16 on at

    Thank you Amik! I had to make some of the column names case sensitive, but it worked! I never would have figured that out.  Thanks again 🙂

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard