cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User II
Super User II

Re: Multiple gallery filters with multiple data sources?

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

Highlighted
Super User
Super User

Re: Multiple gallery filters with multiple data sources?

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

Highlighted
Super User II
Super User II

Re: Multiple gallery filters with multiple data sources?

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
Highlighted
Super User II
Super User II

Re: Multiple gallery filters with multiple data sources?

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

Highlighted
Super User
Super User

Re: Multiple gallery filters with multiple data sources?

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

Highlighted
Post Patron
Post Patron

Re: Multiple gallery filters with multiple data sources?

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?

Highlighted
Super User II
Super User II

Re: Multiple gallery filters with multiple data sources?

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?

Highlighted
Post Patron
Post Patron

Re: Multiple gallery filters with multiple data sources?

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?

Highlighted
Super User II
Super User II

Re: Multiple gallery filters with multiple data sources?

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

Highlighted
Post Patron
Post Patron

Re: Multiple gallery filters with multiple data sources?

@DavesTechTips Works a treat THANK YOU

so simple when you know how!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

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