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 / Display empty gallery ...
Power Apps
Unanswered

Display empty gallery when text box has no value

(0) ShareShare
ReportReport
Posted on by 173

Hi, I have a gallery tied with textbox and  am looking to display empty gallery, when the textbox is blank. I have the below formula, but it gives me error, please advise.

 

 

Filter(Search(Contacts,TextInput2.Text,"lastname"),!IsBlank(TextInput2.Text))

 

Categories:
I have the same question (0)
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @sdnd2000 

     

     

    With(
     {item: Contacts},
     If(
     IsBlank(TextInput2.Text),
     Blank(),
     Search(
     item,
     TextInput2.Text,
     "lastname"
     )
     )
    )

     


    Thanks,
    Stalin - Learn To Illuminate

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @sdnd2000 

     

    I have tested and correctly the above code. This is also similar.

     

    With(
     {item: Contacts},
     If(
     !IsBlank(TextInput2.Text),
     Search(
     item,
     TextInput2.Text,
     "lastname"
     )
     )
    )

     


    Thanks,
    Stalin - Learn To Illuminate

     

  • sdnd2000 Profile Picture
    173 on at

    Hi, @StalinPonnusamy , thanks for the help, it doesn't work as expected, since there is only on result returned, is it limiting the number of result set?

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @sdnd2000 

     

    Shouldn't be. Our requirement is

    1. Gallery will be empty when no text on the Search
    2. Gallery display based on search

    Case #1

    StalinPonnusamy_0-1637112569975.png

     

    Case #2

    StalinPonnusamy_1-1637112601312.png

     

    Code

    With(
     {item: IssueTracker},
     If(
     !IsBlank(TextSearchBox1.Text),
     Search(
     item,
     TextSearchBox1.Text,
     "Title"
     )
     )
    )

     

    Please share your data source if this not works

     

  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi @StalinPonnusamy  - potentially delegation issue with 'search'?

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    It shouldn't be. I tested with Dataverse data as well

     

    With(
     {item: [@Contacts]},
     If(
     !IsBlank(TextSearchBox1.Text),
     Search(
     item,
     TextSearchBox1.Text,
     "lastname"
     )
     )
    )

    StalinPonnusamy_0-1637113921137.png

     

  • sdnd2000 Profile Picture
    173 on at

    @StalinPonnusamy 

    I tested with the below code, and the result is different, not sure why, 

    Filter(Search(Contacts,Tx_SearchBx.Text,"lastname"),!IsBlank(Tx_SearchBx.Text))

    My.png

    And your code just returns one result, 

    He.png

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    That's really surprising. Both queries are the same and give the same results for me. That is expected.

     

    StalinPonnusamy_0-1637212030259.png

    StalinPonnusamy_1-1637212055631.png

     

    Only the difference is no delegation issue when using With Statement.


    Thanks,
    Stalin - Learn To Illuminate

  • Sri Profile Picture
    559 on at

    Hi,

    In my case I have two text input fields(number type) in a form. When both text boxes has value the above Billability calculates the value. I have a requirement of when both text boxes is empty the formula should not calculate and should be blank like this( Billability :  %). As of now when both text boxes is empty it displays in this way.( Billability : 0 %).

    Any help would be greatly appreciated

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard