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

ClearCollect function - Insert two data sources in one gallery

(0) ShareShare
ReportReport
Posted on by 775

Hello all,

I have a question regarding the integration of multiple data sources in a gallery in PowerApps. I have read that the only way to do this is to use the ClearCollect funktion.

 

I have built the following so far:

All created vacation requests are displayed in the gallery with the respective status. The data is stored in a sharepoint list. But now I have created another sharepoint list, where all travel requests are in it, and these must also be displayed in the gallery. How can I now use the ClearCollect function to display both data sources in one gallery?

Without destroying the already created status formula. (See picture) That means, if I click afterwards on the respective status button like "Genehmigt", all requests must be indicated (vacation requests and travel requests) which were approved. 

Some ideas?

 

PowerSm_0-1630320360641.png

 

I hope I could explain it relatively understandable.

 

Many thanks in advance

Categories:
  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @PowerSäm ,

    Just think that the Sharepoint server side don't know to execute the if () part.

    Try this approach: 

    If(varFilter="Alle";
     Datasource;
     Filter(DataSource;Status.Value=varFilter)
    )

     Importing all data from a datasource is not a solution when we talking about large datasource, the server answer will be limited to first 500-2000 records. 

     

    Hope it helps !

  • Verified answer
    max81 Profile Picture
    860 on at

    Hello @PowerSäm ,

     

    you can use "collect" (not clearcollect) to create a collection with the data of both SharePoint lists.

    To show it easily in one gallery, the field names in both lists must be the same, otherwise you get additional columns in your collection.

    Than you must change the data source for your gallery to the collection.

    So maybe replace "Urlaubsplanung" with "colUrlaubReise".

     

    Example:

    SharePoint Urlaubsplanung

    IDTitleSingleLineTextColumnA
    1Testbla 111
    2New Testblo222

     

    SharePoint Reiseplanung

    IDTitleSingleLineTextColumnB
    1TitleAja333
    2TitleBnein444

     

    Collect(colUrlaubReise, Urlaubsplanung); Collect(colUrlaubReise, Reiseplanung); 

     

    colUrlaubReise

    IDTitleSingleLineTextColumnAColumnB
    1Testbla111 
    2New Testblo222 
    1TitleAja 333
    2TitleBnein 444

     

    Greetings,

    Max

     

     

  • PowerSäm Profile Picture
    775 on at

    @max81 Thanks for your replay.

    That worked perfectly!

  • Mana Profile Picture
    171 on at

    Hi ,

    What if the columns are not the same, I have the following Data sourses :

    Collect(ListElements, Filter(Office365Groups.ListOwnedGroups().value, "Group" in displayName));
    Collect(ListElements,Office365Users.SearchUser({top:999}))

     

    but I cant use ListElements in my Last galley since I have 2 different columns to join; displayName and DisplayName.

    Can you pls help me to merge these twodata sources together?

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard