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 / How to avoid displayin...
Power Apps
Answered

How to avoid displaying repeated data in a gallery

(0) ShareShare
ReportReport
Posted on by 119

I have a gallery in which I am showing data from a dropdown, when selecting an item from the dropdown the gallery is loaded with the corresponding data.

 

To display the data in the gallery I make use of the Items property in which I make use of the following formula:

 

Filter(
'Warehouse';
'RecordAssigment'.Id_record = Dropdown1.Selected.Result;
StartsWith(
'Description ';
TextInput1.Text
)
)

 

What I want to avoid is that repeated data is displayed in my gallery, the following is an example of the data list, I want to avoid showing repeated data such as "Germany" or "Spain".

Description: "United Kingdom",
Description: "Germany",      
Description: "Spain",         
Description: "Germany",      
Description: "Spain",        
Description: "Germany"
I tried adding the Distinct function to the Items property of the Dropdown, but it didn't work.
 
Distinct('Warehouse';'RecordAssigment'.Id_record)
Someone knows that another function I can use to prevent the data from repeating.
Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at

    Hi @sebastianslz ,

    This is "almost" Delegable as the top filter needs to return less records than your Delegation limit (it can query any number of records)

    With(
     {
     wList:
     Filter(
     'Warehouse';
     'RecordAssigment'.Id_record = Dropdown1.Selected.Result &&
     StartsWith(
     'Description ';
     TextInput1.Text
     )
     )
     },
     With(
     {
     wGroups:
     AddColumns(
     GroupBy(
     wList;
     "Description ";
     "Data"
     ),
     "gID";
     First(Data).ID
     )
     },
     Filter(
     wList;
     ID in wGroups.gID
     )
    )

     

    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.

    Visit my blog Practical Power Apps

  • sebastianslz Profile Picture
    119 on at
    Hi @WarrenBelz 

    Thanks
    for your answer, I still do not test it in my app, but could you explain a little what the With function does and why they use AddColumns and GroupBy.
  • WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at

    @sebastianslz ,

    I have a blog on the With function that may assist, but essentially it is setting a Table Variable (call it a Collection) of your filtered data - it has a limit in output governed by Delegation, but I suspect yours will be well within it. I then use GroupBy() to get the unique Description records, but this returns only one field (Description), so I also capture the ID of those records and further filter the Record Variable (at the top) by the ID, getting your entire records back for the gallery.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard