cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mike2020
New Member

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

 

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

 

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (62,544)