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 / There is NOT a way to ...
Power Apps
Answered

There is NOT a way to permanently delete a collection?

(0) ShareShare
ReportReport
Posted on by 1,259 Moderator

I'm reposting this as the last solution given did not work and it was a long time ago.  I'm hoping there is a solution to this as it could be the reason to NEVER use collections in a powerapps.

I have a Collection that is populated from a Sharepoint List and it would copy in the correct column names.  However, somehow, the columns in the list now differ from what is in the Sharepoint List.  I have NO IDEA how this would even be possible, since all the data from the list is there, but the columns are different.

 

Even if I change the columns in the Sharepoint List, Refresh It, and ClearCollect it again from the Sharepoint List it will not change the column names it already has.

 

Therefore, I think this is definitely a PowerApps bug, since I can use the names in the collection, even though it makes no logical sense as to why this works.  However, I believe there has to be a way to completely remove a collection so that you can start again.  Surely people are not just creating a bunch of dead collections because there is no way to remove them?

 

I appreciate any help on what is turning into a MAJOR issue with the use of PowerApps and I'm really surprised no one has mentioned this a lot since if you ever create a collection with your app it will always be there forever from everything I've read on the internet.  I hope someone says I'm dumb and here is the easy solution... I really do...

 

THANK YOU!!!

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,383 Most Valuable Professional on at

    Remember that column names in SharePoint have both an internal name (set when the column is created) and a Display name that can be changed. I suspect what you are seeing is the internal name of the column.  That will always stay the same even if you change the column name in SharePoint and refresh the data connection.  You can check the internal column name by going to the column settings and looking at the name that is at the end of the URL when looking at the setting. If that is not what you are describing could you provide some examples of what you are seeing?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @subsguts 

    What you are describing is not a bug related to collections. SharePoint lists retain the original names given to columns when the list is created. If the names are changed later, the display names are not always used.  My advice is to never change column names once they are created but if you do, be aware of this issue.

  • subsguts Profile Picture
    1,259 Moderator on at

    Unfortunately, this is not the case.  I had an app that was building a collection from Sharepoint and let's say there was a column called Street_Address.  The App was working fine with this for a long time.  Then for no apparent reason it decided that this should be called Street.  I didn't change the names of the columns in the list.  All of a sudden I got a bunch of "x"s in my app.  It had changed 3 column names.  I think this is a bug and that it has something to do with having multiple collections that have similarly named fields.  To reiterate, I had working code against a SP list that stopped working without me changing the code.

     

    In addition, Is everyone here agreeing that if you create 20 collections in your app you will ALWAYS have 20 collections, whether you use them or not, they are going to show up in the app FOREVER?

    My solution to getting the right names will be to recreate the SP List as a new one and then reconnect the existing Collection to the new Sharepoint list.  I assume making a new SP list base on the one with the correct names and reconnecting the collections to this new collection built on the new list will cause the names in the collection and the list to Match?  (I'm going to try this in a test app and I'll post the results, but Appreciate comments on this and my question about getting rid of collections permanently, which appears, still to be impossible?

     

    Thank you

  • subsguts Profile Picture
    1,259 Moderator on at

    My questions, in my last reply, outstanding, the display name is indeed the problem.  However, I don't know how that internal name got changed.  That is the bug, and I really think something strange happened, as I'm not sure how the original code was working for a week, then I added some new sections, and collections to my fluid grid and that's when it broke.  I will mark you answer as correct for how to deal with the issue, but I would like to keep this discussion open to find out:

    1.  How do you delete a collection or do they stay with your app forever once created?  In other words, I don't want them showing up under the View-Collections?

    2.  If you create a new Sharepoint list, based on the original one, with a Create List - using existing SP List, will it carry over the old display names, or do you have to create the Sharepoint List from scratch to change column names?  BTW, use of this display name and SP not updating it I do consider a SP bug or at least a horrible design 🙂

     

    Thank you so much.

  • subsguts Profile Picture
    1,259 Moderator on at

    Sorry for all the posts, question 2.  Creating a new SP list based on the original retains the Display Names.  So you have to create a new list to change the "Display Name".  Pretty awful, but it can be done and I will as the names don't make sense.  So still want to find out about question 1, permanently removing the collections.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @subsguts 

    Your question is absurd. Collections are temporary tables created from data that exist in memory only as long as the session is active. They disappear when the app is closed and must be re-created again when the app is instantiated. They can be removed using the Clear() function during a session.

  • subsguts Profile Picture
    1,259 Moderator on at

    How can the collection exist, if all references to it in the app are removed?

    There was a discussion on this in 2021, and that was the "Solution".  You shouldn't have a temporary table be around forever.  In the previous post, they said if you eliminated all references to the collection in your code it would disappear.  However, I have found it never disappears once created it will always be there.  I will do testing on this as maybe I didn't get rid of all the occurrences and report back.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @subsguts 

    Somewhere in your code there is either a Collect() or a ClearCollect() function that is creating your collection. Find that function and delete it and the collection will not be created. You can search for it using the new find option on the left side of the screen.

  • subsguts Profile Picture
    1,259 Moderator on at

    Thanks Drrickryp, I will try that out.  Appreciate the quick responses!

  • Verified answer
    Pstork1 Profile Picture
    69,383 Most Valuable Professional on at

    @Drrickryp is correct.  The collection gets instantiated in the collection list because it is referenced in the app, whether that Collect or ClearCollect runs or not.  I just ran a test where I created an app and added a button that in the onSelect ran a ClearCollect().  Saving and closing the app did not remove the collection.  But if I removed the actual reference in the OnSelect the collection disappeared.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard