cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Englishweb
Post Patron
Post Patron

Multiple gallery filters with multiple data sources?

Hello

Is it possible to combine several filters to display a gallery from different datatables using If/Or' 

eg:

Filter(FDPTABLE11; Matieres = DropdownMatieres.Selected.Result) Or

Filter(FDPTABLE12; Matieres = DropdownMatieres.Selected.Result) Or

Filter(FDPTABLE13; Matieres = DropdownMatieres.Selected.Result) etc?

I've read a post about stacking galleries on top of each other and making each one visible, is there another way?

Thanks in advance 

3 ACCEPTED SOLUTIONS

Accepted Solutions
DavesTechTips
Super User
Super User

Hello @Englishweb ,

 

If you want to collect data from various datasources I would consider using a collection, depending on the size of the data.

ClearCollect(localData,List1);
Collect(localData,List2)

 

Then use the localData collection in the Gallery items property.

 

Let me know if you don't come right 😉

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please like it and mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

View solution in original post

rebeccas
Community Champion
Community Champion

You can combine your data sources using a collection and then to have multiple filtering options you can do an If statement on your Items for the Gallery that looks for the various filtering options or what I do sometimes is make them select the filtering choices first and then have a "Get Data" button or something that creates the collection after they have selected the filters they want...seems to run a little faster. Both work though.

View solution in original post

Hello @Englishweb ,

 

Apologies, I think I now know what you would like to do.

 

Is the data in the various data sources have exactly the same fields, you can use one one Gallery with an If or Switch statement.

 

The Items property for the gallery could be set to:

Switch(Dropdown2.SelectedText.Value,
"1",
List1,
"2",
List2)

OR

If(
    Dropdown2.SelectedText.Value = "1",
    List1,
    Dropdown2.SelectedText.Value = "2",
    List2,
    ElseListName
)

 

The gallery will show the data from the two lists depending on which items is selected in the drop down.

 

Below is a picture from an example:

Choose Datasource in Gallery.jpg

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please like it and mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

View solution in original post

7 REPLIES 7
DavesTechTips
Super User
Super User

Hello @Englishweb ,

 

If you want to collect data from various datasources I would consider using a collection, depending on the size of the data.

ClearCollect(localData,List1);
Collect(localData,List2)

 

Then use the localData collection in the Gallery items property.

 

Let me know if you don't come right 😉

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please like it and mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

rebeccas
Community Champion
Community Champion

You can combine your data sources using a collection and then to have multiple filtering options you can do an If statement on your Items for the Gallery that looks for the various filtering options or what I do sometimes is make them select the filtering choices first and then have a "Get Data" button or something that creates the collection after they have selected the filters they want...seems to run a little faster. Both work though.

Hi @rebeccas @DavesTechTips 

Thanks for your speedy replies.

In fact, its not the data collection which is a problem, it is displaying (overlaying) each gallery according to the dropdown codes, on the same screen.

Perhaps navigating to separate screens for each gallery would be the easiest solution? Will that slow down the app if I have 15 separate galleries?

If you are happy with displaying the data in different galleries, you can hide the entire gallery with the visible property, depending on the selection in the drop down?

Hi Dave

I have this filter which works: Filter(FDPTABLE11; Matieres = DropdownMatieres.Selected.Result)

so far so good,

but I don't know how to add to this in order to combine multiple filters to show other galleries - a conditional "if " statement?

Hello @Englishweb ,

 

Apologies, I think I now know what you would like to do.

 

Is the data in the various data sources have exactly the same fields, you can use one one Gallery with an If or Switch statement.

 

The Items property for the gallery could be set to:

Switch(Dropdown2.SelectedText.Value,
"1",
List1,
"2",
List2)

OR

If(
    Dropdown2.SelectedText.Value = "1",
    List1,
    Dropdown2.SelectedText.Value = "2",
    List2,
    ElseListName
)

 

The gallery will show the data from the two lists depending on which items is selected in the drop down.

 

Below is a picture from an example:

Choose Datasource in Gallery.jpg

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please like it and mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

@DavesTechTips Works a treat THANK YOU

so simple when you know how!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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