cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Piter_D
Post Patron
Post Patron

Problem with filtering by multiple select values in combobox

Hi, i have problem with filtering gallery by few values in combobox4_1

This is my code, which are created with support @RandyHayes :

 

With(
    {
        _preFilter: Filter(
            TabCrysisSP,
            StartsWith(
                Item,
                TextSearchBox1.Text
            ),
            StartsWith(
                MCO,
                TextSearchBox2.Text
            ),
            StartsWith(
                'Type no',
                TextSearchBox4.Text
            ),
            IsBlank(ComboBox2_1.Selected.Result) || Vendor = ComboBox2_1.Selected.Result,
            IsBlank(ComboBox2.Selected.Value) || CFT.Value = ComboBox2.Selected.Value,
            IsBlank(ComboBox1.Selected.Value) || Status.Value = ComboBox1.Selected.Value,
            IsBlank(ComboBox3.Selected.Value) || Action.Value = ComboBox3.Selected.Value,
            IsBlank(ComboBox4.Selected.Value) || Criticality.Value = ComboBox4.Selected.Value
        )
    },
    SortByColumns(
        Filter(
            _preFilter,
            IsBlank(ComboBox4_1.Selected.Result) || ComboBox4_1.Selected.Result exactin 'Production Line'
        ),
        "Created",
        If(
            SortDescending1,
            Descending,
            Ascending
        )
    )
)

 

 and i have problem with this function exactly:

 

IsBlank(ComboBox4_1.Selected.Result) || ComboBox4_1.Selected.Result exactin 'Production Line'

 

i allow multiple selections, but when someone chooses 2 values, then only one is return in gallery 

1 ACCEPTED SOLUTION

Accepted Solutions
Mister_Shaik
Solution Sage
Solution Sage

My bad, I've just noticed that you're using ".Selected" instead of ".SelectedItems"

 

Please try changing the code to below and try again:

IsBlank(ComboBox4_1.Selected.Result) || 'Production Line' in ComboBox4_1.SelectedItems.Result

 

Kind Regards,

Shaik Sha
________________________________________________________________________

If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

5 REPLIES 5
Mister_Shaik
Solution Sage
Solution Sage

Hi @Piter_D ,

 

Assuming that 'Production Line' is a string, the condition you wrote is checking if a set of choices (the multiple inputs from ComboBox) exists in a string, which is not correct.

 

Try replacing the ComboBox4_1.Selected.Result with 'Production Line'

 

 

IsBlank(ComboBox4_1.Selected.Result) || 'Production Line' in ComboBox4_1.Selected.Result

 

 

Please let me know if this works or if my assumption is wrong.

 

Kind Regards,

Shaik Sha
________________________________________________________________________

If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

unfortunately it does not work, if I choose two values, it filters on the second value

maybe something would work that after each onchange I would save the value of the selected value in a variable and then filter by this variable?

Mister_Shaik
Solution Sage
Solution Sage

My bad, I've just noticed that you're using ".Selected" instead of ".SelectedItems"

 

Please try changing the code to below and try again:

IsBlank(ComboBox4_1.Selected.Result) || 'Production Line' in ComboBox4_1.SelectedItems.Result

 

Kind Regards,

Shaik Sha
________________________________________________________________________

If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

Yaaas, thank you very much! 😄

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,343)