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 / Filter Search with mul...
Power Apps
Answered

Filter Search with multiple options to search not returning record

(0) ShareShare
ReportReport
Posted on by 1,176

Hi,

I have an app which a SharePoint list as a datasource.

I'm trying to search by persons name but some of the other search criteria isn't present in the SharePoint site so that person doesn't appear.

How can I get round this???

ClarkyPA365_0-1693496086496.png

 

ClarkyPA365_1-1693496120341.png

 

Categories:
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @ClarkyPA365 - please share the code you're currently using in the Items property of what I assume is a Gallery (share the code as text). I also assume the Applications Name field is a SharePoint People field?

  • Chris1968 Profile Picture
    1,176 on at

    Hi,

    Here is the code that I'm currently using

    Filter(
    'Applications Processing',
    If(
    AppsProg_Txt.Text <> "",
    'Apprenticeship Programme' = AppsProg_Txt.Text,
    true
    ) && If(
    AppsName_Txt.Text <> "",
    'Applicants Name' = AppsName_Txt.Text,
    true
    ) && If(
    Provider_Txt.Text <> "",
    Provider = Provider_Txt.Text,
    true
    ) && If(
    'Applicants Status'.Value,
    AppsStatus_Txt.Text
    )
    )

    The Applicant Names field column type is Single Line of Text
    Apprenticeship Program field column type is also Single Line of Text as is the Provider field type.
    Applicants Status field type is Choice..

    I've also tried these formulas 

    //Filter('Applications Processing',StartsWith('Apprenticeship Programme',AppsProg_Txt.Text),StartsWith('Applicants Name',AppsName_Txt.Text),StartsWith(Provider,Provider_Txt.Text),StartsWith('Applicants Status'.Value,AppsStatus_Txt.Text))

    //Filter('Applications Processing', AppsName_Txt.Text in 'Applicants Name', AppsProg_Txt.Text in 'Apprenticeship Programme', Provider_Txt.Text in Provider, AppsStatus_Txt.Text in 'Applicants Status'.Value)

     

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @ClarkyPA365 ,

     

    Consider using the following pattern instead:

     

    Filter(
     'Applications Processing',
     Len(AppsProg_Txt.Text) = 0 || 'Apprenticeship Programme' = AppsProg_Txt.Text,
     Len(AppsName_Txt.Text) = 0 || 'Applicants Name' = AppsName_Txt.Text,
     Len(Provider_Txt.Text) = 0 || Provider = Provider_Txt.Text,
     Len(AppsStatus_Txt.Text) = 0 || 'Applicants Status'.Value = AppsStatus_Txt.Text //assume this is a single choice field
    )
    

     

    On a related note. You could use the Search function, but this function is not delegable. You could alternatively use the StartsWith function but unfortunately, this function is not delegable with complex field types, so you will receive a delegation warning when applying the function to your Choice field.

     

    Filter(
     'Applications Processing',
     Len(AppsProg_Txt.Text) = 0 || StartsWith(
     'Apprenticeship Programme',
     AppsProg_Txt.Text
     ),
     Len(AppsName_Txt.Text) = 0 || StartsWith(
     'Applicants Name',
     AppsName_Txt.Text
     ),
     Len(Provider_Txt.Text) = 0 || StartsWith(
     Provider,
     Provider_Txt.Text
     ),
     Len(AppsStatus_Txt.Text) = 0 || StartsWith(
     'Applicants Status'.Value,
     AppsStatus_Txt.Text
     )
    )
    

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • Chris1968 Profile Picture
    1,176 on at

    Hi @Amik 

    Thank you for the two solutions provided...

    The last solution resolves the issue.  There won't be too many records that are added over of the period of the apprenticeship selection period so the delegation shouldn't be an issue.  

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @ClarkyPA365 - if delegation is not going to be a concern, then use nested Search. It is far more flexible than StartsWith:

     

    With(
     {
     _data: AddColumns(
     'Applications Processing',
     "_appstatus",
     'Applicants Status'.Value,
     )
     },
     Search(
     Search(
     Search(
     Search(
     _data,
     AppsProg_Txt.Text,
     "Apprenticeship Programme Logical Name"
     ),
     AppsName_Txt.Text,
     "Applicants Name Logical Name"
     ),
     Provider_Txt.Text,
     "Provider Logical Name"
     ),
     AppsStatus_Txt.Text,
     "_appstatus"
     )
    )
    

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

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 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard