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 / ClearCollect not clear...
Power Apps
Answered

ClearCollect not clearing the collection ??

(0) ShareShare
ReportReport
Posted on by 166

I have a table in Dataverse called "Document Masters' with 8 records.  I have an Alternate key set so that I do not get duplicates on Document Number.

 

In a Canvas App I have been using a collection - colGridData. I have a button with:

ClearCollect(colGridData, 'Document Masters');
Set(varX, CountRows(colGridData));

 

I link this to a Gallery.  When i run this, the gallery fills with close to 100 records.  varX =8.

 

I then ran the same code on a different collection name (colTest).  This time it works as expected, 8 rows in the Gallery and varX=8.

 

It seems like colGridData is picking up old records from somewhere.  I checked in the Monitor app, and it shows many Sort operations running when i use colGridData, but not when i use colTest.

 

Is there some way to re-initialize a collection ?

Regards

Dave

I have the same question (0)
  • Verified answer
    Daved1 Profile Picture
    166 on at

    Issue was resolved.  Looks like i had a problem with my Data source.  I deleted the 'Document Masters' data source, then re-added it, and like magic everything works as expected now.  I recently moved this solution from my Default environment into a Dev environment, so this is probably reason why i had issues ...


    Regards

    Dave

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard