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 / Message for no data found
Power Apps
Answered

Message for no data found

(0) ShareShare
ReportReport
Posted on by 70

Hello,

 

Need some direction on my task in power apps.

 

I have a form with few text input fields and a button . User inputs a value in a text input 1 field and presses the button which populates next of the text fields . The button is pulling the information from sharepoint library. This aspect is working fine.

 

What i want is to trigger a message or pop up saying 'no data found' when search button returns no data for the requested text input  . How can i handle this ?

 

The code OnSelect button is as follows - ContractID is the text input 1 field entered to search for product type and customer name.

 

UpdateContext({AppIDVar:First(Filter(collect1,ContractID=TextInput1_ContractID.Text)).ApplicationID});

UpdateContext({ProductTypeVar:First(Filter(collect1, ContractID=TextInput1_ContractID.Text)).ProductType});

UpdateContext({CustomerNameVar:First(Filter(collect1, ContractID=TextInput1_ContractID.Text)).CustomerName});

 

Thanks

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,554 Most Valuable Professional on at

    I normally do this by creating a Label that has the text of the message I want to display in it and then set the visibility of that label based on the RowCount of the data in the gallery.  If the RowCount is greater than 0 then hide the label, otherwise show it.

  • bsoleti Profile Picture
    70 on at

    Thank You for the feedback. I tried adding to Onvisible property of the label this way.

     

    If (CountRows(collect1) > 0,false)

     

    Its not working as expected . There is always some data in the collection . I am missing something like adding Clear(collect1) ?

     

    Please suggest any other alternatives.

     

    Thanks

  • Pstork1 Profile Picture
    69,554 Most Valuable Professional on at

    You should Clear the collection before each search.  So I would put the Clear() as the first statement in your Search button or when you refresh the filter.  You should also make sure you set the visible to true if the value isn't >0 otherwise it will never reset.

  • Verified answer
    bsoleti Profile Picture
    70 on at

    Thanks very much . Your solution works.

  • ST1 Profile Picture
    Microsoft Employee on at

    @Pstork1  Hi, please could you expand on what the whole formula should look like? Including the if<0, false and if not <0, true. Thanks!

  • Verified answer
    Pstork1 Profile Picture
    69,554 Most Valuable Professional on at

    The following formula goes in the visible property of the label.

    If (CountRows(collect1) > 0,false,true)
  • bsoleti Profile Picture
    70 on at

    Thanks very much . Your solution works

     

    Regards

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard