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

Filtering a Gallery with two dropdowns simultaneously

Hey, I am thinking about this problem now a few days and maybe someone is out there, who can help me:

 

I have a gallery, which should filtered by a Text search box and two comboboxes. 

I set the items category of the gallery to the code which you can see below.

Here my problem:

Everything is working properly, except when I have selected filter arguments in both of the two comboboxes. Then the gallery is displaying nth. 

To be considered:

the items of one of the comboboxes is a collection, which is based on a concat function ( I also added the code)

I can ignore delegation, bc the dataset is not too big.

 

If(
    Or(
        IsEmpty(ComboBox2.SelectedItems),
        IsEmpty(ComboBox2.SelectedItems)
    ) And Or(
        IsEmpty(ComboBox2_1.SelectedItems),
        IsBlank(ComboBox2_1.SelectedItems)
    ) And IsEmpty(TextInput1),
    'Report Documentation Reports',
    Or(
        IsEmpty(ComboBox2_1.SelectedItems),
        IsBlank(ComboBox2_1.SelectedItems)
    ) And Or(
        IsEmpty(ComboBox2.SelectedItems),
        IsEmpty(ComboBox2.SelectedItems)
    ),
    Filter(
        'Report Documentation Reports',
        StartsWith(
            'Report Name',
            TextInput1.Text
        )
    ),
    Or(
        IsEmpty(ComboBox2.SelectedItems),
        IsEmpty(ComboBox2.SelectedItems)
    ) And IsEmpty(TextInput1),
    Filter(
        'Report Documentation Reports',
        ComboBox2_1.Selected.Result exactin Tags
    ),
    Or(
        IsEmpty(ComboBox2_1.SelectedItems),
        IsBlank(ComboBox2_1.SelectedItems)
    ) And IsEmpty(TextInput1),
    Filter(
        'Report Documentation Reports',
        Workspace in ComboBox2.SelectedItems
    ),
    IsEmpty(TextInput1),
    Filter(
        'Report Documentation Reports',
        Tags in ComboBox2_1.SelectedItems || Workspace in ComboBox2.SelectedItems
    ),
    Or(
        IsEmpty(ComboBox2_1.SelectedItems),
        IsBlank(ComboBox2_1.SelectedItems)
    ),
    Filter(
        'Report Documentation Reports',
        Workspace in ComboBox2.SelectedItems And StartsWith(
            'Report Name',
            TextInput1.Text
        )
    ),
    Or(
        IsEmpty(ComboBox2.SelectedItems),
        IsEmpty(ComboBox2.SelectedItems)
    ),
    Filter(
        'Report Documentation Reports',
        ComboBox2_1.Selected.Result exactin Tags And StartsWith(
            'Report Name',
            TextInput1.Text
        )
    )
)
Collect(TagsCollect, (Split(Concat('Report Documentation Reports', Tags), "#")));

 

 

 

 

4 REPLIES 4
theapurva
Super User
Super User

Hello,
I believe, you can shorten your formula as below:

Filter(
        'Report Documentation Reports',
		StartsWith(
            'Report Name',
            TextInput1.Text
        ),
       IsBlank(ComboBox2.SelectedItems)||IsEmpty(ComboBox2.SelectedItems)||Workspace in ComboBox2.SelectedItems, IsBlank(ComboBox2_1.SelectedItems)||IsEmpty(ComboBox2_1.SelectedItems)||Tags in ComboBox2_1.SelectedItems 
		
    )

 

-----------------------------------------------------------------------------------
Liked My Solution? Click on the Thumbs Up below.
Did I answer your Question? Please Click Accept as Solution below

Want to Support me? Buy Me A Coffee

Thank you very much for your help.

Unfortunately, I still have the problem, that when I select filter arguments in both comboboxes the gallery is displaying nothing. Additionally, the Tags dropdown is somehow not working with this shorter code...

 

theapurva
Super User
Super User

My bad:

please try below:

Filter(
        'Report Documentation Reports',
		StartsWith(
            'Report Name',
            TextInput1.Text
        ),
       IsBlank(ComboBox2.SelectedItems)||IsEmpty(ComboBox2.SelectedItems)||Workspace in ComboBox2.SelectedItems.Value, IsBlank(ComboBox2_1.SelectedItems)||IsEmpty(ComboBox2_1.SelectedItems)||Tags in ComboBox2_1.SelectedItems.Value
		
    )
 

with my code we are putting And condition on combobox i.e if you select X as Workspace and Y as Tag, item should have X and Y both.

 

If you want to use Or, please try below:

Filter(
        'Report Documentation Reports',
		StartsWith(
            'Report Name',
            TextInput1.Text
        ),
       (IsBlank(ComboBox2.SelectedItems)||IsEmpty(ComboBox2.SelectedItems)||Workspace in ComboBox2.SelectedItems)|| (IsBlank(ComboBox2_1.SelectedItems)||IsEmpty(ComboBox2_1.SelectedItems)||Tags in ComboBox2_1.SelectedItems) 
		
    )
 
-----------------------------------------------------------------------------------
Liked My Solution? Click on the Thumbs Up below.
Did I answer your Question? Please Click Accept as Solution below

Want to Support me? Buy Me A Coffee

Thank you very much again.

Unfortunately, It also is not working with this code: the .Value is underlined in red. And the comboboxes are also not filtering in any case... 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,335)