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 3 collect...
Power Apps
Unanswered

ClearCollect 3 collections

(0) ShareShare
ReportReport
Posted on by 49

Hi fellow PowerApps ninjas,

 

I am wondering if I can make a collection from 3 other collections. 

 

Here is the scenario:

I have 3 SP lists: Products, Reports, KPIs. There is a hierarchy among them: all KPIs belong to a specific report and all reports belong to a specific product - there are lookup columns as well in the Reports and KPIs lists pointing to their relevant upper category item.

 

In my PowerApps application I have a search screen and I'd like to do the search in the 3 lists globally and then give back the results in a gallery, where one label indicates if the found item is a product, a report or a KPI - plus some other attributes.

 

My code looks as follows:

ClearCollect(searchProductResults,
 Search(
 AddColumns(
 'PRODUCTS',
"Columns list"
 ),
SearchText.Text, 
"Columns list"
)
);

ClearCollect(searchReportResults,
Search(
 AddColumns('REPORTS',
 "Columns list"),
 SearchText.Text,
 "Columns list")
);

ClearCollect(searchKPIResults,
Search(
 AddColumns('KPIS',
 "Columns"),
 SearchText.Text,
 "Columns list")
);


ClearCollect(searchAllResults,searchProductResults,searchReportResults,searchKPIResults) 

 

If I add just any of the 2 of the above 3 collections into the "searchAllResults" collection, it works fine. 

 

However when trying to add the 3rd collection, it gives an error of "The given types are incompatible". 

It's definitely not because interfering column types because otherwise it wouldn't work adding just 2 collections. 

 

I haven't found any info on whether 3 (or more) collections can be added into a merged collection. 

Any suggestion you could give me? 

Dataverse and SQL are not options at the minute, unfortunately, due to lack of funding at my company.

 

Thanks in advance for any help here!

 

Cheers,

Tamás 

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Gellai_Tamas 

    Collections can appended to each other providing all the columns have exactly the same names.  Collections can be merged on a common field using AddColumns to provide the identity of record and the column names being added.  One process increased the length of the list, the other increases the width of the list. 

  • Gellai_Tamas Profile Picture
    49 on at

    Hi @Drrickryp ,

     

    Thanks a lot for your answer. Any chance you can help with a code sample for such a newbie PowerApps user like me?

     

    Given the following lists and columns - how a threefold collection merge would look like?

     

    PRODUCTS

    • ProductID
    • ProductName
    • Further columns

     

    REPORTS

    • ProductID
    • ReportID
    • ReportName
    • ProductName (this is a lookup column, shouldn't be used in PowerApps I assume)
    • Further columns

     

    KPIS

    • ProductID
    • ReportID
    • KPIID
    • KPIName
    • ReportName (this is a lookup column, shouldn't be used in PowerApps I assume)
    • Further columns

     

    Thanks,

    Tamás

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard