Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

How do I find where a Collection is created?

Is there an easy way to find the place in an app where the Collection is created versus looking through each component?

Resident Rockstar
Resident Rockstar

Go to File -> Collection or View -> Collection


Frequent Visitor

Yes, I know how to go look at the collection.  What I want to know is the place or action in the app the actually creates the collection via Collect, ClearCollect, etc. for example in an OnVisible action or OnSelect action.

Resident Rockstar
Resident Rockstar

ahh.. then answer is unfortunately no. 

Kudo Collector
Kudo Collector

Some info for people struggling with "Where The Hell DID I create that collection"......


First of all, vote for at least ONE of these two ideas/suggestions. 






The PApps team has them as Under Review but they seem to be stuck there.  More votes will get that moving, hopefully.

Also, in the meantime, there are at least two workarounds/hacks for locating where a collection is defined (e.g. ClearCollect, Collect).


I describe one method using a .zip export of the app in the aforementioned threads here (and I'm now pretty certain the person I should have given credit to for that trick is @TML , btw) :


But here is the newest method I've become aware of...and it may be the better way.. though still deciding on that....

I.e. the "PowerAppps Review Tool" available here:


It allows you to export an app as an MSApp file and see all your functions, and it highlights what formulas/properties have been changed from the PApps default values.  You can export the report as JSON or HTML.  This is easier than the export as .ZIP and extract method I described.


Do be aware that the tool can APPEAR to hang (e.g. Not Responding) when you open your MSAPP file.   I.e. it can take SEVERAL minutes for the tool to chew through the app and generate the report.


Here is an example screenshot of a report:


Advocate I
Advocate I

My Work Around
Instead of a collections I created Variable Tables. Happened by accident and they work. Stakeholders kept changing how they wanted things named, from lists to column names to lookup items. So I put everything in OnStart and can all be changed from there so none of my code breaks.

Set(varListName, 'ListName')

There were only a few places in my app that I actually needed to create a collection. One is where I needed to add the "New" item selection to a combo box 
For that I did

ClearCollect(collectListName, varListName ); //Where varListName is created in OnStart from the SP list
Collect(collectListName, { Title: "New", ID: 0 }


Also if you need to use collections you can also assign a dummy variable like

ClearCollect(collectListName, ListName ); Set(varCollectListName,Blank()))

and that way you will always find the collection


Hope that helps someone

Thanks much, @CrashWave !  I especially like the idea of using the global var "tagging" to make it easier to locate collection creations.  PITA that we have to do such a workaround, but your technique is MUCH easier than doing the export/search technique to hunt collection instantiations.  That even extends to allow you to use it to record what/when the collection was modified.  E.g.


ClearCollect(coll_ItemsRequiringCollectionUsage, 'dbo.MySQLViewName' );
, {"LocationModified : "App.OnStart Line 35", "TimeStampModified : Now()}


I'm pretty **bleep** certain you've sold me on that idea!


As for using (global) table variables instead of collections, that's also a great idea....but I'm a bit more hesitant on using that as I've become (too?) comfortable with collections as my "data table" objects.  But, I'm seeing occasional weirdness with ClearCollect not always clearing (forcing me to now "belt&suspender" every ClearCollect by adding a preceding Clear). Perhaps that strangeness coupled with your suggestion is enough to force me to abandon collections going forward.  If you bump into any other "gotchas" or lessons-learned from using table vars instead of collections, it would be great to hear them.


Thanks so much for sharing!

Helpful resources

October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022


Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,318)