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 / Multiple filter delega...
Power Apps
Answered

Multiple filter delegation issue

(0) ShareShare
ReportReport
Posted on by 10

Hi everybody,

 

I have the following issue:

I have a Datasource ( SP library, 'OfferSubmissions') connected to a Power App. 

In the App I have a gallery that I want to filter by two conditions:

 

1. first condition=

I want to filter the gallery by checking whether the current App user has files submitted in the according SP library in the person column 'Submitter Name':

Filter('OfferSubmissions', Submitter Name'.Email = Var_User_EMail)

 
2. condition=
I have a searchbar in the App where users can browse for their files
Filter('OfferSubmissions,'ProductSearchBox_1.Text in Name)
 
Both work individually but not when combined. I suspect delegation being the cause,
Anyone able to help me?
 
Thank you and best regards
JHL
 
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,513 Most Valuable Professional on at

    Its not really delegation that is causing the problem.  The issue is that 'in' won't match anything if the search box is empty, so in the second condition it filters out everything unless there is a search term. You need to use an IF() based on whether the search box isBlank().  If it is you only use condition 1.  If its not then you use the dual conditions.

     

    if(isBlank(ProductSearchBox_1.Text),Filter('OfferSubmissions', Submitter Name'.Email = Var_User_EMail),Filter('OfferSubmissions', Submitter Name'.Email = Var_User_EMail,'ProductSearchBox_1.Text in Name))

    Since 'in' isn't delegable it would be better to nest the two filters in the false case, but it will work either way till you hit the data row limit.

     

  • JHL12 Profile Picture
    10 on at

    Hi @Pstork1,

     

    thank you for taking the time to respond to this.

    I understand what you are suggesting and I have put it to work right away. However, only the first If condition is returned correctly, so when the searchbox is indeed blank. 
    For the second condition what happens is, the very moment I enter something the 'in-filter' fails and returns a blank gallery.

    If I put to work the 'in filter' by itself, it works, but as soon as I add the second condition it breaks.

    Do you have an idea why that might be?

     

    BR

    JHL

  • Pstork1 Profile Picture
    69,513 Most Valuable Professional on at

    Can you show me the code you are using?  Also what data type is the field you are using 'in' to search? Another problem might be that I don't think 'in' will find partial matches, only full word matches.

  • JHL12 Profile Picture
    10 on at

    Hi @Pstork1 ,

    thank you for the support. Sure, here it is:

     

    If(
    IsBlank(ProductSearchBox_1.Text),
    Filter('OfferSubmissions', 'Submitter Name'.Email = Var_User_EMail),
    Filter(
    'OfferSubmissions', ProductSearchBox_1.Text in Name,'Submitter Name'.Email = Var_User_EMail))

     

     

    The destination-column in the SP library is the Name column of the SP library. So the one, where you can click to preview the file. Not sure how exactly it is called but in PAu it would be called 'File content'. Hope you get, what I mean.

    If you have any other suggestion how to achieve what I am after (applying the two conditions to the gallery)

    Id be delighted giving it a go.

     

    Thank you and best regards

    JHL

  • Verified answer
    Pstork1 Profile Picture
    69,513 Most Valuable Professional on at

    I just put together a quick prototype and the following works for me without the IF()

    Filter(Filter(Documents,'Created By'.Email = Var_User_EMail), ProductSearchBox_1.Text in Name)

    This has the added benefit that it will work with large lists as long as the person used in the inner filter doesn't have more than the record count limit for themselves.

  • JHL12 Profile Picture
    10 on at

    Hi @Pstork1 ,

    thank you for your help! This did it.

    All credits to you🙏🙏

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 414

#2
Valantis Profile Picture

Valantis 408

#3
timl Profile Picture

timl 339 Super User 2026 Season 1

Last 30 days Overall leaderboard