cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EYOST
Level: Powered On

Show Gallery from any combo boxes selected

Hi All Expert here,

 

I was searching very long if there is any other efficient way to show the gallery based on the combo boxes selected.

For example, there are 5 combo boxes, user doesn't have to select all the five combo boxes to get the result in the gallery.

They can select items in 1 or 2 or 3 of the combo boxes, then the gallery will show the result which fulfilled the selected items.

 

I have tried many ways to write the script but it still doesn't work.

Except IF ELSE/SWITCH, is there any alternative way? which search/filter easier/faster way for many input fields?

 

Thanks in advanced!

6 REPLIES 6
Dual Super User
Dual Super User

Re: Show Gallery from any combo boxes selected

Hi @EYOST 

 

Can you please share more information about the logical implementation of this? Since, you have 5 different comboboxes and this is not certain if all of them will be selected, we can try out someting with the && and || conditions but not certain if we can completely eliminate the "IF" loop. Please share more details so that we might help you better.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
EYOST
Level: Powered On

Re: Show Gallery from any combo boxes selected

@yashag2255 

 

First of all, thanks for your response.

Here are the examples, I need to search Mobile Phones based on Model, Brand, Color, Memory Size and Store.

Sometimes, I wish to see Store A have what models there, then I just need to select Store A and leave other combo box empty.

Or I can search based on the color(Blue) and the memory size(258GB), then I will see the models which are Blue and 258GB in the Gallery.

I tried to write in these ways:

- Filter(Table, if(..., ...),if(..., ...),if(..., ...),if(..., ...),if(..., ...))
- Search(Search(Search...)...)...)
- Filter(Table, ... && ... && ... && ... && ...)

All above,the gallery only shown result after all 5 combo boxes are selected.

If I use OR||, the results will be something like outer join, right? 

Is it only can use Nested IF inside another Nested IF (maybe more levels)? 

Thank you

 

Dual Super User
Dual Super User

Re: Show Gallery from any combo boxes selected

Hi @EYOST 

 

Can you try to modify your expression as:
 
Filter(
    DataSourceName,
    If(
        IsBlank(ComboboxStore.SelectedItems),
        true,
        Store in ComboboxStore.SelectedItems.Store
    ) && If(
        IsBlank(ComboboxModel.SelectedItems),
        true,
        Model in ComboboxModel.SelectedItems.Model
    )&& If(
        IsBlank(ComboboxBrand.SelectedItems),
        true,
        Brand in ComboboxBrand.SelectedItems.Brand
    )&& If(
        IsBlank(ComboboxColor.SelectedItems),
        true,
        Color in ComboboxColor.SelectedItems.Color
    )&& If(
        IsBlank(ComboboxMemory.SelectedItems),
        true,
        Memory in ComboboxMemory.SelectedItems.Memory
    )
)
 
Please make the necessary changes for the Data Source name and control names with their attributes.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
EYOST
Level: Powered On

Re: Show Gallery from any combo boxes selected

@yashag2255 
Thanks for your suggestion, I have tried but the result only shown after all of the combo boxes selected.

I tried to change && to ||. The result is correct if only one combo box is selected. However, the results are the combination of multiple selection if multiple combo boxes are selected(inner join), it doesn't show like full outer join.

Dual Super User
Dual Super User

Re: Show Gallery from any combo boxes selected

Hey @EYOST 

 

If you want to get a full outer join, please use the expression:
Filter(
    List1,
    If(
        CountRows(ComboBox1.SelectedItems) = 0,
        false,
        Store in ComboBox1.SelectedItems.Store
    ) || If(
        CountRows(ComboBox2.SelectedItems) = 0,
        false,
        Brand in ComboBox2.SelectedItems.Brand
    ) || If(
        CountRows(ComboBox3.SelectedItems) = 0,
        false,
        Color in ComboBox3.SelectedItems.Color
    ) || If(
        CountRows(ComboBox4.SelectedItems) = 0,
        false,
        Model in ComboBox4.SelectedItems.Model
    ) || If(
        CountRows(ComboBox5.SelectedItems) = 0,
        false,
        Memory in ComboBox3.SelectedItems.Memory
    )
)
 
I carried out a test on my side and this works.MicrosoftTeams-image (47).png

 

Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
EYOST
Level: Powered On

Re: Show Gallery from any combo boxes selected

@yashag2255 
Very sorry that I wrote wrongly in my last reply.

Please read the correction in Magenta below.

I tried to change && to ||. The result is correct if only one combo box is selected. However, the results are the combination of multiple selection if multiple combo boxes are selected(full outer join), it doesn't show like inner join.
Full outer join is as mentioned by you in the last reply

May I know about inner join?

Thank you so much!

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,513)