Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Adding search function to gallery being filtered by a gallery

(0) ShareShare
ReportReport
Posted on by

Hello I am struggling with adding the search function to the top part of my If statement. I set up a gallery and added buttons but i cannot for the life of me get it to search when the filter is set to 'All'

 

 

If(
 GalFilter.Selected.Filter = "All",
 'SIO Sub K',
 Filter(
 Search('SIO Sub K', TextInput1.Text, "Title"),
 Status.Value = GalFilter.Selected.Filter
 )
)

 

Categories:
  • kelseytran Profile Picture
    kelseytran 292 on at
    Re: Adding search function to gallery being filtered by a gallery

    Of course! Glad I could help!

  • dhubach Profile Picture
    dhubach on at
    Re: Adding search function to gallery being filtered by a gallery

    Swapped out isempty with is blank and worked like a charm. You just saved my day. Thank you so much!

  • Verified answer
    kelseytran Profile Picture
    kelseytran 292 on at
    Re: Adding search function to gallery being filtered by a gallery

    Hi @dhubach ,

     

    Try this code. You'll have to adjust where it says 'Title' and 'Description' depending on what 

    whatever columns you're using the search for/trying to search.

    If(
     GalFilter.Selected.Filter = "All",
     If(
     IsEmpty(TextInput1.Text),
     'SIO Sub K',
     Filter(
     'SIO Sub K',
     Or(
     StartsWith(Title, TextInput1.Text),
     StartsWith(Description, TextInput1.Text)
     )
     )
     ),
     Filter(
     'SIO Sub K',
     Status.Value = GalFilter.Selected.Filter &&
     Or(
     IsEmpty(TextInput1.Text),
     StartsWith(Title, TextInput1.Text),
     StartsWith(Description, TextInput1.Text)
     )
     )
    )

     

  • ANB Profile Picture
    ANB 7,060 on at
    Re: Adding search function to gallery being filtered by a gallery

    Hi @dhubach , Try this

    EDITED:

     

    If(
     GalFilter.Selected.Filter = "All",
     Filter('SIO Sub K', Status.Value in ["Approve","Reject","Pending", "In-Progress"]),
     Search( Filter(
     'SIO Sub K', 
     Status.Value = GalFilter.Selected.Filter
     ),TextInput1.Text, "Title"),
    )

     

     

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

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard