cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

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

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

v-monli-msft
Community Support
Community Support

Hi @Anonymous,

 

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.

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.

Anonymous
Not applicable

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

 

Have a nice day!

 

Cheers,

Joakim

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,449)