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 / Join two databases on ...
Power Apps
Answered

Join two databases on on one gallery ?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have two database and I want to display items in one gallery

 

For example :

Database1 

item 1 (column1, column2)

item 2 (column1, column2) 

item 3 (column1, column2)

 

Database2

item 4 (column3, column4)

item 5 (column3, column4) 

item 6 (column3, column4)

 

I want to display in my gallery

 

Item1 (column1, column2) 

Item2 (column1, column2) 

Item3 (column1, column2) 

Item4 (column3, column4)

Item5 (column3, column4)

Item6 (column3, column4)

 

Is it possible ?

 

Thanks !

Categories:
  • zmorek Profile Picture
    3,272 on at

    No, one datasource at a given time per gallery, however you can do some Switch() statements to say "use X data source for this condition, or Y data source for that condition"... However that requires both datasources to have the same schema (i.e. columns).

     

    You might however be able to simply look up data from your second datasource to your gallery containing the first, assuming there's some sort of key column that you can use. You might also just create a collection containing the data from both datasources that you need, then use the collection on the gallery. What are you trying to achieve exactly?

  • Verified answer
    Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at

    Yes, it's possible. You have two things going on: you're trying to "union" two datasets. (That's the term used in SQL for this sort of operation). An additional challenge is that your two datasets have different field names. 

     

    Meneghino provided the solution to unioning here.

     

    Ungroup(Table({MyTables: TableA},{MyTables: TableB}), "MyTables")

    The above function could be used in the items property of a gallery, and will union together the rows from tablea and tableb. The issue is that both tables need to have the same column names for this to work. 

     

    So here's a variation:

    Ungroup(Table({MyTables: varMyTable1},{MyTables: RenameColumns(varMyTable2,"Color2","Color")}), "MyTables")

    In the above example, I'm using variables that have tables, but you could use just tables. My table1 has columns of ID and Color. Table 2 has ID and Color2. The ungroup is unioning varMyTable1 to the result of the rename operation, which changes the name of Color2 to Color. 

     

     

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard