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 / How to create a effect...
Power Apps
Answered

How to create a effective search option for overall gallery items irrespective of tabs selection filters ??

(1) ShareShare
ReportReport
Posted on by 143

Hello Guys,

 

I have a code which says to filter according to the selected tab as shown in screenshot (Alive projects, Closed Projects, All Projects).

I also want to filter the gallery as per the column names (shown in same screenshot) so at the end of the if function I wrote something highlighted in RED. 

When I select any three tabs, the code works fine but when I try to search any column items using SearchBar_2 text input it is not at all working even for single column items search.

DataSource:- Project_Table (Excel)

 

If(
    varAliveP = true && varClosedP = false && varUpcMilP = false,
    Filter(Project_Table,Alive_Project = "Yes"),
    If(
    varAliveP = false && varClosedP = true && varUpcMilP = false,
    Filter(Project_Table,Alive_Project = "No"),
    If(
    varAliveP = false && varClosedP = false && varUpcMilP = true,
    Project_Table,
        If(IsBlank(SearchBar_2.Text&&
        varAliveP = true || varAliveP = false ||
        varClosedP = true || varClosedP = false ||
        varUpcMilP = true || varUpcMilP = false,
        Project_Table,Filter(Project_Table,StartsWith(Customer,SearchBar_2.Text)))
    ))
)
 
Please Help me in modifying this code. How can I use both search option and tabs in a same screen. Do I have to create search option for individual tabs ?? how can I make it generic ?? I can't use normal search function since my data source is excel.
 
I badly need help to finish this task!!!
 
Thank you in advance
filter query (2).PNG
Categories:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi,

     

    It's best to not nest your if statements inside each other, you can add them on as additional 'else if' conditions as I have done below. Additionally, we can include the filtering by textbox by including it with each filter but only searching where the text is more than zero characters (there are minor bugs with IsBlank where it doesnt always detect it as blank)

     

     

    If(
     varAliveP = true && varClosedP = false && varUpcMilP = false,
     Filter(
     Project_Table,
     Alive_Project = "Yes", 
     //Either there is no text in the searchbox or else we start to filter by the text
     (
     Len(SearchBar_2.Text)=0
     || 
     StartsWith(Customer,SearchBar_2.Text)
     )
     ),
    
     varAliveP = false && varClosedP = true && varUpcMilP = false,
     Filter(
     Project_Table,
     Alive_Project = "No", 
     //Either there is no text in the searchbox or else we start to filter by the text
     (
     Len(SearchBar_2.Text)=0
     || 
     StartsWith(Customer,SearchBar_2.Text)
     )
     ),
    
     varAliveP = false && varClosedP = false && varUpcMilP = true,
     Filter(
     Project_Table, 
     //Either there is no text in the searchbox or else we start to filter by the text
     (
     Len(SearchBar_2.Text)=0
     || 
     StartsWith(Customer,SearchBar_2.Text)
     )
     ),
     //Catch-all where none of the above conditionsis true and we only filter by searched text if it exists
     Filter(
     Project_Table, 
     //Either there is no text in the searchbox or else we start to filter by the text
     (
     Len(SearchBar_2.Text)=0
     || 
     StartsWith(Customer,SearchBar_2.Text)
     )
     )
    )

     

     

  • Verified answer
    RMeena_9 Profile Picture
    143 on at

    Hello @iAm_ManCat,

     

    Thankyou so much for your support it worked pretty well 🙂 🙂

    I am so happy 

    Only problem is it is showing delegation error (blue highlight near || (OR) in the code  between Len and StartsWith)

     

    Will it be ok ?? my data source has around 80 rows with above mentioned columns in screenshot.

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Yes the default delegable limit is 500 and you can increase this in the App settings to 2000, so your 80 rows falls far underneath the limit

  • RMeena_9 Profile Picture
    143 on at

    Thank 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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard