cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mike2020
Regular Visitor

Filter Gallery From Form Selection

Hello All,

I have a form with multiple dropdown choices, "Form1".

The drop downs are named DataCardValue1,2,3,4 etc.

I need those drop downs which exist within that form to filter a gallery, "Gallery1".

If all 4 drop values match a row in the Gallery then only that row's value should be shown in the gallery.

If all 4 drop down values do not match, or any number of the drop downs have not yet been selected then the gallery should remain blank.

So only once all 4 values have been matched should the gallery display anything.

 

I'm really stuck on what the arguments should be to make this happen. I've tried If functions and Filter funcitions but i'm not getting anywhere.

 

How should I approach this? Any help would be appreciated.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @Mike2020,

Do you want to filter the Gallery1 based on the Form1?

Could you please tell that:

  1. how you set the Item property of the Form1?
  2. are DataCardValue1,2,3,4  are all Combo Boxes?
  3. what is your data source, SP list or Dataverse?
  4. do these 4 drop down selected correspond to 4 columns in your data source, what is the column type, Choice?

I am confused why would you like to filter the Gallery1 based on the Form1, we used to filter the form based on the Gallery1.Selected, please provide more details.

Please provide the above details.

Generally, if you have 4 Choice columns and 4 Combo Box, you could try the formula set on the Items of the Gallery1:

If((!IsBlank(DataCardValue1.Selected.Value) || !IsEmpty(DataCardValue1.Selected.Value))
&&(!IsBlank(DataCardValue2.Selected.Value) || !IsEmpty(DataCardValue2.Selected.Value))
&&(!IsBlank(DataCardValue3.Selected.Value) || !IsEmpty(DataCardValue3.Selected.Value))
&&(!IsBlank(DataCardValue4.Selected.Value) || !IsEmpty(DataCardValue4.Selected.Value)),
Filter(YourDateSource,Column1.Value=DataCardValue1.Selected.Value && 
                      Column2.Value=DataCardValue2.Selected.Value &&
                      Column3.Value=DataCardValue3.Selected.Value &&
                      Column4.Value=DataCardValue2.Selected.Value &&
       )

Hope it could help you.

Regards,

Qi

 

Best Regards,
Qi

View solution in original post

2 REPLIES 2
v-qiaqi-msft
Community Support
Community Support

Hi @Mike2020,

Do you want to filter the Gallery1 based on the Form1?

Could you please tell that:

  1. how you set the Item property of the Form1?
  2. are DataCardValue1,2,3,4  are all Combo Boxes?
  3. what is your data source, SP list or Dataverse?
  4. do these 4 drop down selected correspond to 4 columns in your data source, what is the column type, Choice?

I am confused why would you like to filter the Gallery1 based on the Form1, we used to filter the form based on the Gallery1.Selected, please provide more details.

Please provide the above details.

Generally, if you have 4 Choice columns and 4 Combo Box, you could try the formula set on the Items of the Gallery1:

If((!IsBlank(DataCardValue1.Selected.Value) || !IsEmpty(DataCardValue1.Selected.Value))
&&(!IsBlank(DataCardValue2.Selected.Value) || !IsEmpty(DataCardValue2.Selected.Value))
&&(!IsBlank(DataCardValue3.Selected.Value) || !IsEmpty(DataCardValue3.Selected.Value))
&&(!IsBlank(DataCardValue4.Selected.Value) || !IsEmpty(DataCardValue4.Selected.Value)),
Filter(YourDateSource,Column1.Value=DataCardValue1.Selected.Value && 
                      Column2.Value=DataCardValue2.Selected.Value &&
                      Column3.Value=DataCardValue3.Selected.Value &&
                      Column4.Value=DataCardValue2.Selected.Value &&
       )

Hope it could help you.

Regards,

Qi

 

Best Regards,
Qi

View solution in original post

Thanks Qi,

You were 99.9% Correct.

Just for others viewing this;

'YourDatsource' has the commas either side.

And the last && was actually )) for my use case.

Column1.Value and Column2.Value wouldn't let me have the ".Value" part of it. It ends up being just Column1 and Column2. Both 3 and 4 allowed .Value

This might be due to the column type. Columns 1 and 2 in my SharePoint list are text, Columns 3 and 4 are a text but are choice format. 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,360)