web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trying to have Power A...
Power Apps
Unanswered

Trying to have Power App data set return values in multi level And/Or combination

(0) ShareShare
ReportReport
Posted on by 14

I am looking to build a multi level search filter to display a smart drill down search's results.

 

My search logic would look like this:

[ComboBox1.selections AND ComboBox2.selections] And [Combobox3.selections OR Combobox4.selection OR ...]

 

The goal is to select the required areas from boxes 1 and 2 which would show combinations of an and search, and then filtered again by any of the remaining listing that would have the attributes selected in ComboBoxes included in the second half or statement. I have been able to make all individual combobox selections return good data, just having trouble layering properly for a drill down type functionality.

 

Thank you in advance!

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Slavinsm 

    Try something like this:

     

    With(
     {prefilter: Filter(
     datasource, Field1 in ComboBox1.SelectedItems,
     Field2 in ComboBox2.SelectedItems
     )
     },
     Filter(
     prefilter, Field3 in Combobox3.SelectedItems|| 
     Field4 in Combobox4.SelectedItems|| 
     etc.
     )
     )
    ) 

     

  • Slavinsm Profile Picture
    14 on at

    @Drrickryp I have been adjusting code but keep getting a notification on the Prefilter entry. I have inserted my combobox entries below into the provided structure. The only wrinkle is that I have a multi or identifier but I do not believe that should affect the filter and display outcome. 

     

    With(
          {​​​​​​​​​​​​​​​​​​​​​​​​prefilter: Filter(
                             TestRuleset,
                                         'Business Process 1 Application' in 'ComboBox.AppSelect'.SelectedItems.Result Or 'Business Process 2 Application' in 'ComboBox.AppSelect'.SelectedItems.Result,
                                         'Business Area' in ComboBox_BusinessArea.SelectedItems.Result
                     )
          }​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​,
          Filter(
                 prefilter, 'Business Process 1' in 'ComboBox.BPSelect'.SelectedItems.Result Or 'Business Process 2' in 'ComboBox.BPSelect'.SelectedItems.Result||
                 'Risk Severity' in ComboBox_RiskSelect.SelectedItems.Result
          )
       )
    )
  • Slavinsm Profile Picture
    14 on at

    I am having errors flag on the prefilter function call. Looking at some of the smart inserts so unclear what would flag that. 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Slavinsm 

    I'm not surprised, your syntax is incorrect.  Please provide the following:

    • The actual name of your dataset
    • The name of comboboxes 
    • Are the comboxes' Allow multiple selections true or false?
    • The field names that the comboboxes are based on.

    and I will try to figure it out with you.

  • Slavinsm Profile Picture
    14 on at

    @Drrickryp Thank you for the assistance! I have also attached a screenshot for a visual. Again this would be a structure of [Combobox1 and Combobox2] and [Combobox3 or Combobox4 or...

     

    All combo boxes are Allow Multiple selections - True.

    The big item is that combobox 2&4 are to trigger filtering off of if items exist in either of two columns for the data set. I have included the OR statements.

     

    My entities are as follows:

    Dataset: TestRuleset_FromExcels

     

    Combo Box 1: selecting data when ['Business Area' in ComboBox_BusinessArea.SelectedItems.Result]

    name: ComboBox_BusinessArea

    fields: Distinct(TestRuleset_FromExcels, cr4f1_businessarea)

     

    ComboBox 2: selecting data when ['Business Process 1 Application' in 'ComboBox.AppSelect'.SelectedItems.Result Or 'Business Process 2 Application' in 'ComboBox.AppSelect'.SelectedItems.Result]

    name: ComboBox.AppSelect

    fields: 

    Filter(
    Distinct(
    Split(
    Concat(
    TestRuleset_FromExcels,'Hybrid Applications' & ";"
    ),
    ";"
    ),
    Result
    ),
    !IsBlank(Result)
    )

    ComboBox 3: selecting data when ['Risk Severity' in ComboBox_RiskSelect.SelectedItems.Result]

    name: ComboBox_RiskSelect

    fields: Distinct(TestRuleset_FromExcels, 'Risk Severity')

     

    Combobox 4: selecting data when [ComboBox.BPSelect'.SelectedItems.Result Or 'Business Process 2' in 'ComboBox.BPSelect'.SelectedItems.Result]

    name: ComboBox.BPSelect

    fields: 

    Filter(
    Distinct(
    Split(
    Concat(
    TestRuleset_FromExcels,'Hybrid Process' & ";"
    ),
    ";"
    ),
    Result
    ),
    !IsBlank(Result)
    )

     

    Multi Select filter drill.png
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Slavinsm 

    Do your comboboxes work and show the data when you open them or is that what you are trying to work out?  I am assuming that your  gallery will depend on the comboboxes. 

  • Slavinsm Profile Picture
    14 on at

    @Drrickryp yes all combo boxes show selectable data and function. in the previous post the "show data when" information is the call that I have currently been able to utilize a filter on the individual criteria. This issue is combining all calls into the group filtering logic.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard