cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoakimAndersson
Level: Powered On

Multiple tables in Gallery.item ?

Hello!

I'm pretty new to this so bear with me. Smiley Happy

 

Is it possible to have more than one table in the item property of a gallery?

 

I want something like this:

Gallery1.items=Table1 + Table2

 

Is this possible to do? I have searched this forum for answers, but I can’t find one. Please let me know if the question is too simply formulated or id you need more information to answer the question. 

 

Cheers!

//Joakim

  

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft Employee

Re: Multiple tables in Gallery.item ?

You could create a collection out of 2 tables and then assign the collectino to the Gallery. Note that this will not work if there's a slightest change in table schemas though.

Demo:

Assuming that you have Table1 and Table2, add 2 buttons and a gallery control.

Button1.OnSelect = Collect(zzz, Table1)

Button2.OnSelect = Collect(zzz, Table2)

Gallery.Items = zzz

Now click on both buttons.

I just tested this with 2 Excel tables. Hope this helps.

4 REPLIES 4
Microsoft Employee

Re: Multiple tables in Gallery.item ?

You could create a collection out of 2 tables and then assign the collectino to the Gallery. Note that this will not work if there's a slightest change in table schemas though.

Demo:

Assuming that you have Table1 and Table2, add 2 buttons and a gallery control.

Button1.OnSelect = Collect(zzz, Table1)

Button2.OnSelect = Collect(zzz, Table2)

Gallery.Items = zzz

Now click on both buttons.

I just tested this with 2 Excel tables. Hope this helps.

Community Support Team
Community Support Team

Re: Multiple tables in Gallery.item ?

Hi @JoakimAndersson,

 

Each Gallery could only be connected to one data source. Since you have 2 table which is 2 data sources for Gallery control, you could use the workaround that @dinusc has suggested. 

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Mike8
Level 10

Re: Multiple tables in Gallery.item ?

Hello,

An other approach can be this:

Button1.OnSelect = ClearCollect(Collection1,{text:"A"},{text:"B"});ClearCollect(Collection2,{ID:3,text:"C"},{ID:4,text:"D"})
Gallery1.Items = Ungroup(Table({column1:Collection1},{column1:Collection2}),"column1")

Collection1 and Collection2 are the tables you want to display in the same gallery.
This way you don't duplicate your data to a third collection.

Highlighted
JoakimAndersson
Level: Powered On

Re: Multiple tables in Gallery.item ?

This solutiong works great for me. Thank you for taking the time to help me.

 

Have a nice day!

 

Cheers,

Joakim

 

 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 323 members 5,028 guests
Please welcome our newest community members: