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 / fx for displaying a bu...
Power Apps
Answered

fx for displaying a button if user has data in gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

HI

I have a a few screens, one of my screens is for another user, user2 to complete a section.

On this screen I would like to place a button 'my forms' and would like it to be disabled if the user does not have any submitted forms in the gallery.

I have tried a few fx but cannot get it right to work, is someone aware what the function to use on the DisplayMode property?

 

Thanks

Categories:
I have the same question (0)
  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    Can you try to set the DisplayMode of the button as:

    If(CountRows(Gallery1.AllItems) = 0, DisplayMode.Disabled, DisplayMode.Edit)

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    HI @yashag2255 

     

    Thanks, I tried something similar to that and it didn't work prior to posting my question, and I've tried your suggested function and it's the same behaviour the button is not disabled for a user who has no created items created by them and I believe the fx requires some logic?

    i.e. currently I'm filtering Gallery1 with the following fx:

     

    'Created By'.Email=VarUser

     

    Thanks

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    apologies, it works, looks like it took a little while longer for the published version to kick in

    Thanks

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard