web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / If search is blank the...
Power Apps
Answered

If search is blank then show nothing in gallery

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I'm fairly new to Power Apps, however I'm in the building of creating one and I'm having a few issues...

 

I'm using the below query to filter the search, however when the search field is empty, currently it shows everything available, rather than showing a blank gallery...can someone please help me work out how to do this?

 

Query being used:

SortByColumns
  (Search
    (Filter
      ('Purchase Order Requests',
        (Title = "Pending" Or Title = "Submitted" Or Title = "Open" Or Title = "Further Action Required")),
        POFilterInput.Text,'PO Number','Requisition Number'),"ID",SortOrder.Descending)

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    hey @HSK2507 

     

    can you try this:

    If(
     IsBlank(POFilterInput.Text),
     ClearCollect(EmptyGallery, {}),
     SortByColumns(
     Search(
     Filter(
     'Purchase Order Requests',
     Title = "Pending" Or 
     Title = "Submitted" Or 
     Title = "Open" Or 
     Title = "Further Action Required"
     ),
     POFilterNext.Text,
     'PO Number',
     'Requisition Number'
     ),
     "ID",
     SortOrder.Descending
     )
    )
    

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

     

  • HSK2507 Profile Picture
    on at

    Thanks for the response @mmbr1606, I have tried this however it has not made the gallery blank. Do I need to replace Empty Gallery with the gallery name at all?

  • Verified answer
    HSK2507 Profile Picture
    on at

    I've managed sort it using the below, @mmbr1606 you we're almost there...

     

    If(!IsBlank(POFilterInput.Text),
    SortByColumns
        (Search
            (Filter
                ('Purchase Order Requests',
                    (Title = "Pending" Or Title = "Submitted" Or Title = "Open" Or Title = "Further Action Required")),
                        POFilterInput.Text,'PO Number','Requisition Number'),"ID",SortOrder.Descending))

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 405 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 280 Super User 2025 Season 2

#3
Kalathiya Profile Picture

Kalathiya 272

Last 30 days Overall leaderboard