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 / Create a collection fr...
Power Apps
Unanswered

Create a collection from multiple collections

(0) ShareShare
ReportReport
Posted on by 364

Hi all, 

 

Like my subject line says, I am wondering how I can create a collection that combines data from multiple collections. In an app I have, there are 5 different collections that do different things. Each collection does record a "Part #" amongst other things, and I would like to create a collection that grabs the "Part #" from each of these collections. 

 

My collections are "colConnectors", "colAccessories", "colSeals", and "colTerminals" 

 

I am imagining using ClearCollect on a button's OnSelect property to create this collection of collections. I had tried to do something like: 

ClearCollect(colAllParts, {'Part #': ForAll(colConnectors, PartNumber) || ForAll(colTerminal, EndTerminal))

 

But is obviously not working. Can anyone help point me in the right direction for generating this list?

Categories:
I have the same question (0)
  • subsguts Profile Picture
    1,259 Moderator on at
  • AaronKnox Profile Picture
    514 Super User 2024 Season 1 on at

    One approach is to group the *PartNumber column: 

     

    ClearCollect(colAllParts, colConnectors,colAccessories,colSeals,colTerminals); 
    ClearCollect(colAllPartsGrouped, GroupBy(colAllParts, "PartNumber", "_groupedRecords"))

     

     

    This gives you a tidy list of unique PartNumbers and a table of all records for each PartNumber:

    CaptureB.PNG

     

    Then if you want to fetch all records for example, for PartNumber 1AA, you simply have to LookUp that part number from the collection:

     

    LookUp(colAllPartsGrouped, PartNumber="1AA")._groupedRecords

     

    This screenshot is an example for a DataTable:

    CaptureC.PNG

     

    * This assumes all collections have identical column names for PartNumber, if not you will want to AddColumns (or RenameColumns) when building the initial collections to have this common column name. 

    For example, if a list called testList has Part_x0023_ as the column name, you can duplicate this column in a new column called "PartNumber" when collecting:

     

    ClearCollect(colExample,AddColumns(testList,"PartNumber",Part_x0023_ ) ); 

     

    CaptureD.PNG

  • Aurora Profile Picture
    364 on at

    @AaronKnox 

     

    How would I go about showing every single record in colAllPartsGrouped? 

     

    For example, part 1AA might be used for multiple connectors in my connector collection. However, when I use GroupBy I only get 1 record for each part number - even if there are multiple. I realize that the additional records are nested inside the table created when using GroupBy, but is there an easy way to show the number of times each part appears? 

     

    Your initial solution was very helpful for getting me started, I appreciate your feedback.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard