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 / nested filtering using...
Power Apps
Answered

nested filtering using multiple dropdowns and other criteria

(0) ShareShare
ReportReport
Posted on by 256

I've had tremendous help and support from many in this community (especially @WarrenBelz ) to get this far updating our power apps application, but have hit another roadblock. 

 

In my app, I am filtering and displaying rows from a Sharepoint List that contain a specific Manager's name in the dropdown menu (ManagerDropDown). If the dropdown is empty, then it would display all content, regardless of the Manager. This part is working great. The other parts that are working great are the Checkbox (FlagCheckbox), which displays additional rows that have this value set to "true" and the SearchInput1 search box.

 

However, what I cannot seem to get working is when any row from the same SPList has a value set to "true" for the "CU_DirectorHold" field (Type: Yes/No) in SPList. What I would like to do is also display that row/content that matches the selected Director's name in the "DirectorDropDown" dropdown list when the value "CU_DirectorHold" is "true" in SP (regardless of what's in the "ManagerDropDown" dropdown list)

 

Below is the sub-set of the filter code that is working so far, with the exception of the last "If" statement. That code is not working properly and I'm not exactly sure how to include that. I started with adding "&& OR" ( along with the If statement) but nothing returns any value:

 

 

 

Filter(
 Filter(
 LargeSPList,
 Or(
 IsBlank(ManagerDropDown.SelectedItems),
 IsEmpty(ManagerDropDown.SelectedItems),
 CU_Manager in ManagerDropDown.SelectedItems
 ) && Or(
 If(
 FlagCheckbox.Value = true,
 Flag = true,
 If(
 FlagCheckbox.Value = false,
 Flag = true || Flag = false
 )
 )
 //// Below If statement does not work
 ) && Or(
 If(
 CU_DirectorHold = true,
 CU_Director in DirectorDropDown.SelectedItems
 )
 )
 ),
 SearchInput1_1.Text in Title || SearchInput1_1.Text in Notes
 )

 

 

 

would anyone have any ideas how I can code this portion?

 

Many thanks in advance!

Categories:
  • Verified answer
    Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    I'm not sure why you have Filter twice... it's late though so maybe I'm missing something 😂

    Maybe something like this:

    Filter(
     LargeSPList,
     (Or(
     IsBlank(ManagerDropDown.SelectedItems),
     IsEmpty(ManagerDropDown.SelectedItems),
     CU_Manager in ManagerDropDown.SelectedItems
     ) || (CU_DirectorHold = true && CU_Director in DirectorDropDown.SelectedItems))
     && (FlagCheckbox.Value = false || Flag = true)
     && (SearchInput1_1.Text in Title || SearchInput1_1.Text in Notes)
    )
  • Verified answer
    WarrenBelz Profile Picture
    156,520 Most Valuable Professional on at

    @galos .

    My contribution as you tagged me - top statement is to retain some semblance of Delegation here

    With(
     {
     wData,
     Filter(
     LargeSPList,
     Flag = FlagCheckbox.Value
     )
     },
     Filter(
     wData,
     (
     IsEmpty(ManagerDropDown.SelectedItems) ||
     CU_Manager in ManagerDropDown.SelectedItems
     ) &&
     (
     !CU_DirectorHold ||
     CU_Director in DirectorDropDown.SelectedItems
     ) &&
     (
     SearchInput1_1.Text in Title || 
     SearchInput1_1.Text in Notes
     )
     )
    )
  • galos Profile Picture
    256 on at

    Thank you @Rusk ! That did the trick. Of course the success of this helped me realize I'm only half way there, as it's showing me different results than I expected.  So while the filter is showing the results I needed, it's also showing me too much.

     

    To be more descriptive, my struggle is that I'd like to use an IF statement within the filter, but I know I cannot use it within Filter, so how would I go about that?

     

    Ultimately here is what I'm trying to go after next:

     

     

    filter(SPList,
    
     if(CU_DirectorHold = true, 
     CU_Manager in ManagerDropDown.SelectedItems, 
     CU_Director in DirectorDropDown.SelectedItems
     )
    
    )

     

     

    basically, I am looking to have a specific search filter applied (CU_Manager in ManagerDropDown.SelectedItems) when a row within the SPList has a flag set. However, if the flag for that same row is not set, I'd like to apply a different filter (CU_Director in DirectorDropDown.SelectedItems). The resulting output would be a combination of the two filters.  (Keep in mind that this filter is a subset of the above filters that also need to be applied)

     

    Any thoughts on how to accomplish what I'm trying to achieve?

  • galos Profile Picture
    256 on at

    as always, thank you @WarrenBelz ! Quick question regarding this output, is this delegable? I came across your blog (With() Statement managing Delegation – Practical Power Apps) on this same topic (as I've not used "with" before in power apps and you mention there is a 2000 row limit). Does the way you wrote it above avoid the 2000 row limit?

     

    (also, wasn't sure if you had any thoughts on my reply to @Rusk above on applying an "if" type structure within a filter - even though I know "If" can't be used within "Filter")

  • WarrenBelz Profile Picture
    156,520 Most Valuable Professional on at

    Hi @galos ,

    In a partial manner it may assist Delegation - this code

    With(
     {
     wData,
     Filter(
     LargeSPList,
     Flag = FlagCheckbox.Value
     )
     },

    can accept any number of records in the input (LargeSPList), but the output (where the Flag column matches the true/false state of the FlagCheckBox) is limited to your Delegation limit (2,000 records). If there are more than 2,000 matching records, it will only output the first 2,000. If you want the newest 2,000 (something I do a lot)

    With(
     {
     wData,
     Filter(
     Sort(
     LargeSPList,
     ID,
     SortOrder.Descending
     ),
     Flag = FlagCheckbox.Value
     )
     },

    The rest of your filter is not Delegable as you are using the in Filter but you will not get a warning as it is processed "locally" on the output of the top filter. As I mentioned top statement is to retain some semblance of Delegation here

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard