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 / Filter function displa...
Power Apps
Answered

Filter function displaying duplicate record while filtering powerapps gallery

(0) ShareShare
ReportReport
Posted on by 125

Hello all powerapps users,

 

I filter my powerapps gallery according that formula, but filter displaying duplicate records.

 

Formula

 

Filter(myboookablecollection,
Resource.name = Dropdown4.Selected.Value,
Text(
Date(
Year(starttime),
Month(starttime),
Day(starttime)
)
) = Label5.Text
)

Duplicates.jpg

 

Categories:
I have the same question (0)
  • timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    Hi @sachinsoni441 

    How are you populating your myboookablecollection collection? Could you somehow be doing this twice, therefore resulting in duplicate records?

  • sachinsoni441 Profile Picture
    125 on at

    Hello @timl ,

     

    On first screen i store my dynamics entity in collection and use this collection variable in filtererror.jpg

     

  • iamlee Profile Picture
    121 on at

    If you display your collection, what do you see? Is it also double entry? It could be the display is correct as there are 2 valid items meeting your selection criteria. If there's only 1 entry in your collection, try ClearCollect.

  • Verified answer
    RusselThomas Profile Picture
    4,014 on at

    Hi there,

    I agree with Iamlee - there are a variety of possibilities here - "duplicate" in your Gallery might imply you have one record in your source, but it's being served up twice in your Gallery, or it could mean you actually have duplicates in your source.

     

    More often than not, when I get duplicates in a gallery, I find I've used Collect() instead of ClearCollect() for my collection. First step would be to make absolutely sure your source does not actually contain duplicates Smiley Happy

     

    To see which it is, try using or adding a unique index or ID field on the record to show in the Gallery to see if it's actually exactly the same record, or a different record with the same data.

     

    You can also check by collecting your Filter() function in a ClearCollect() function and then going to look at the results in the collection viewer (or just bind them to a data grid to view). You can do this by adding a button and setting it's OnSelect property to;

     

    ClearCollect(myFilterResult, 
     Filter(myboookablecollection, 
     Resource.name = Dropdown4.Selected.Value,
     Text(Date(Year(starttime),Month(starttime),Day(starttime))) = Label5.Text 
     ) 
    ) 
    • If it's returning only one row of data, then we'll have to take a close look at that Gallery.
    • If it's returning two rows, then you have two rows in the source that match the Filter() request - the Gallery is fine and the Filter() is fine, it's the data that has duplicates.
    • If it's returning two different rows but they look the same in the Gallery, check your Gallery data card elements to make sure they're referencing the current row dynamically and not the first result statically.

     

    That's all I can think of for now, can you run some tests and come back with more info?

     

    Kind regards,

     

    RT

  • james_hathaway Profile Picture
    427 on at

    I am experiencing the same issue...

     

    When I use a form to add a new record to a SharePoint Dataset - the record is then shown twice in the Gallery - but interestingly, only when the gallery is showing a Filtered list of records in the datasource - if I remove the filter and have the gallery look at all records in the datasource, there is only one instance of my new record.

     

    I have also double checked the sharepoint list in question (the datasource), and there is definitely only one instance of the newly created record - it is just that the gallery is showing that record twice.

    I have also noticed that the duplicate record is only being shown to the User that created the new record - a second user looking at the app only sees one instance of the newly created record. Also, for the user that created the record, closing and reopening the app solves the issue - the duplicate gallery entry is gone.

     

    So if I have ruled out the fact that the datasource contains 2 records, and the duplicate is only showing on the app for the user that created the record, it must be some sort of bug in PowerApps itself....?

     

    Does anyone know why a Gallery would be showing a newly created record twice?

     

    FYI:

    Gallery Items formula:

         Filter(Datasource, 'Created By'.DisplayName=User().FullName)

    Gallery "Default" formula:

         Gallery_DefaultSel

     

    Form "Save Button" Forumla:

    If( Datasource_Form.Mode = FormMode.New, 

          SubmitForm(Datasource_Form); Set( selectedRecordID, Datasource_Form.LastSubmit.ID),

                   // (My form is decoupled from the gallery - I use this global variable to tell the form which record to look at)

          SubmitForm(Datasource_Form); UpdateContext({Gallery_DefaultSel: Datasource_Gallery.Selected}); 

               ResetForm(Datasource_Form);
    )

     

    James.

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard