cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jNelly
Frequent Visitor

Change a Gallery's data source from a dropdown box

I need some help.

 

I would like to change the data source of my gallery based on the dropdown box. It would be selecting a different table in SQL each time and all the tables have the same columns.

 

I'm really just wondering if this is possible, and if so how it could be done.

2 ACCEPTED SOLUTIONS

Accepted Solutions
alaabitar
Solution Specialist
Solution Specialist

Hello,

 

Yes definitvely possible what you can do is on the onchange of your dropdownlist you update a variable and that variable is binded to the datesource of your gallery.

 

Best regards,

Alaa

View solution in original post

RusselThomas
Microsoft
Microsoft

Hi @jNelly ,

A test with SPO indicates that this works - so I guess as long as all the columns are identical across the SQL tables then no reason it shouldn't work for SQL as well...but best way to tell is to try 😊

Just edit the Gallery Items: property to something like;

If(Dropdown1.Selected.Value = "Source 1", SQLTable1, SQLTable2)

Kind regards,

RT

 

View solution in original post

2 REPLIES 2
alaabitar
Solution Specialist
Solution Specialist

Hello,

 

Yes definitvely possible what you can do is on the onchange of your dropdownlist you update a variable and that variable is binded to the datesource of your gallery.

 

Best regards,

Alaa

RusselThomas
Microsoft
Microsoft

Hi @jNelly ,

A test with SPO indicates that this works - so I guess as long as all the columns are identical across the SQL tables then no reason it shouldn't work for SQL as well...but best way to tell is to try 😊

Just edit the Gallery Items: property to something like;

If(Dropdown1.Selected.Value = "Source 1", SQLTable1, SQLTable2)

Kind regards,

RT

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,261)