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
Highlighted
Microsoft dinusc
Microsoft

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.

View solution in original post

4 REPLIES 4
Highlighted
Microsoft dinusc
Microsoft

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.

View solution in original post

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.
Super User
Super User

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.

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,734)