cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver I
Resolver I

Double Filter for a gallery

Hello everybody,

I would like to determine my gallery content either according to condition 1 (another gallery) or according to condition 2 (dropdown).
Individually, the filters work perfectly, but I can't find the right formula to chain both filters.

 

My table is called: T1_L22_27

T1_L22_27.PNG

Filter 1

Filter 1Filter 1

Filter 2

Filter 2.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Robertjde ,

Could you please share a bit more about your scenario?

Do you want the second Gallery to show records based on the Dropdown selected value or the Gallery1 selected value, rather than combination of the two filters?

On your side, please consider add a ComboBox control to list available Schnellsuche column values instead of the Dropdown control. Set the SelectMultiple property of the ComboBox to false.

 

Set the OnSelect property of the Gallery1 ('Gallery_T1_L22-L27_Regel_Typ_1') to following:

Set(SelectedRegelTyp; 'Gallery_T1_L22-L27_Regel_Typ_1'.Selected.Result);;
Set(SelectedSchnellsuche; Blank())

set the OnChange property of the above ComboBox to following:

Set(SelectedSchnellsuche; ComboBox1.Selected.Result);;
Set(SelectedRegelTyp; Blank())

 

Set the Items property of the second Gallery to following:

Filter(
       T1_L22_27;
       If(
          !IsBlank(SelectedRegelTyp) && IsBlank(SelectedSchnellsuche);
          Regel_Type = SelectedRegelTyp;
          IsBlank(SelectedRegelTyp) && !IsBlank(SelectedSchnellsuche);
          Schnellsuche = SelectedSchnellsuche;
          true
       )
)

You could also consider add a "Reset" button in your app to clear Gallery button selection and ComboBox value selection Filters, set the OnSelect property to following:

Set(SelectedRegelTyp, Blank());
Set(SelectedSchnellsuche, Blank())

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Super User III
Super User III

Try:

Filter(Search(Datasource,SearchBox.Text,"ColumnToSearch1"),Dropdown1.Selected.Result)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Unfortunately does not work.
I removed the search function and actually only want 2 filters for the one gallery.
If the dropdown box is selected, the gallery shows the result and if the button is selected in the other gallery, the gallery shows the result.

please see the pictures above

I tried it but that's not the solution.

Either one or the other should be displayed. no combination!

 

Versuch1.PNG

Hi @Robertjde ,

Could you please share a bit more about your scenario?

Do you want the second Gallery to show records based on the Dropdown selected value or the Gallery1 selected value, rather than combination of the two filters?

On your side, please consider add a ComboBox control to list available Schnellsuche column values instead of the Dropdown control. Set the SelectMultiple property of the ComboBox to false.

 

Set the OnSelect property of the Gallery1 ('Gallery_T1_L22-L27_Regel_Typ_1') to following:

Set(SelectedRegelTyp; 'Gallery_T1_L22-L27_Regel_Typ_1'.Selected.Result);;
Set(SelectedSchnellsuche; Blank())

set the OnChange property of the above ComboBox to following:

Set(SelectedSchnellsuche; ComboBox1.Selected.Result);;
Set(SelectedRegelTyp; Blank())

 

Set the Items property of the second Gallery to following:

Filter(
       T1_L22_27;
       If(
          !IsBlank(SelectedRegelTyp) && IsBlank(SelectedSchnellsuche);
          Regel_Type = SelectedRegelTyp;
          IsBlank(SelectedRegelTyp) && !IsBlank(SelectedSchnellsuche);
          Schnellsuche = SelectedSchnellsuche;
          true
       )
)

You could also consider add a "Reset" button in your app to clear Gallery button selection and ComboBox value selection Filters, set the OnSelect property to following:

Set(SelectedRegelTyp, Blank());
Set(SelectedSchnellsuche, Blank())

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

 

@v-xida-msft  Yes, that's exactly how the app should work.
Unfortunately he brings me errors with this formula (see picture)

 

Versuch2.PNG

Hi @Robertjde ,

Could you please show more details about the formula you typed within the Items property of the ComboBox1?

 

Based on the screenshot that you mentioned, it seems to tell that you could not get the Result attribute under the ComboBox1. If the Items property of your ComboBox1 has been set to a Distinct() formula as below:

Distinct(T1_L22_27; Schnellsuche)

then you could reference the Result attribute under the ComboBox1. Please take a try with above solution, check if the issue is solved.

 

If the Items property of the ComboBox1 is not set to a Distinct formula, you need to modify your formula as below:

Set(SelectedSchnellsuche; ComboBox1.Selected.DisplayColumn);;
Set(SelectedRegelTyp; Blank())

Note: The DisplayColumn represents the column you used as display column value within the ComboBox1. You need to replace it with actual column name.

1.JPG

 

If you use Schnellsuche column as Display column value within the ComboBox1, please modify above formula as below:

Set(SelectedSchnellsuche; ComboBox1.Selected.Schnellsuche);;
Set(SelectedRegelTyp; Blank())

 

In addition, if you could only reference Value property under the ComboBox1.Selected. formula, please modify your formula as below:

Set(SelectedSchnellsuche; ComboBox1.Selected.Value);;
Set(SelectedRegelTyp; Blank())

 

Best regards, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Oh man, long day yesterday. sorry!


The item from the combo box was missing and then it went perfectly!
ComboBox1 Item: Distinct (T1_L22_27; quick search) .Result


Thank you very much for your help @v-xida-msft 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (12,961)