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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Display custom message on screen when gallery has no records to return

(0) ShareShare
ReportReport
Posted on by 1,110

My canvas app has gallery with current user filter. As long as there are records for the logged in user, there are no complaints. But when a user login for the 1st time, obviously there wont be any of his items in the gallery. For this 1st time user when there are no items in the gallery, i dont want to show him  a empty gallery. I would like to display a message on screen "There are no submitted forms currently for you. Please submit a form by clicking on '+' icon above". How do I have this message available for new users and gallery items for old users on the same screen.

I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,987 Moderator on at
    Re: Display custom message on screen when gallery has no records to return

    @RameshMukka 

    You can hide the Gallery by changing its Visible property to this code

    !IsEmpty(Gallery1.AllItems)

     

    Then you can make a label with a custom message that appears when there are no records by putting this code in the Visible property.

    IsEmpty(Gallery1.AllItems)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • rameshmukka Profile Picture
    1,110 on at
    Re: Display custom message on screen when gallery has no records to return

    Do I have to hide other elements on the page as well? Like on my screen below, along with my gallery I have a rectangle, a label, an icon etc.

     

  • mdevaney Profile Picture
    29,987 Moderator on at
    Re: Display custom message on screen when gallery has no records to return

    @RameshMukka 
    No, once the gallery is hidden everything else inside it will disappear as well.  You only have to write the code in one place: the gallery's Visible property and it will take care of everything.

  • rameshmukka Profile Picture
    1,110 on at
    Re: Display custom message on screen when gallery has no records to return

    @mdevaney But my other controls are not shown within the gallery. They are outside gallery. Does gallery allow to have controls inside it?

     

    Capture1.JPG

  • mdevaney Profile Picture
    29,987 Moderator on at
    Re: Display custom message on screen when gallery has no records to return

    @RameshMukka 
    I assumed you were talking about controls inside the gallery.

     

    Yes, you must hide each one using this code in the Visible property

    !IsEmpty(Gallery1.AllItems)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • rameshmukka Profile Picture
    1,110 on at
    Re: Display custom message on screen when gallery has no records to return

    @mdevaney I have a small problem here. There isnt any problem for the new user now. But for a user when there are gallery items the custom message pops up for a second or 2 before the custom message goes hidden and gallery is shown? How can I avoid this custom message to be shown for for a second or 2 when the gallery is not empty. Thanks a lot in advance.

     

    Thanks,

    Ramesh

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 624 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 384 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 246

Last 30 days Overall leaderboard