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

How to avoid displaying repeated data in a gallery

(0) ShareShare
ReportReport
Posted on by 119

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:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,127 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
    153,127 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

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