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 / Power Apps question on...
Power Apps
Answered

Power Apps question on app related to buttons

(1) ShareShare
ReportReport
Posted on by 17
I have an app that has a card with just a label and a button, when you first come into the app the button is disabled until the user hits edit. I had to add a new card and button, and I changed card displaymode DisplayMode.Edit and button displaymode DisplayMode.Edit, just like my other cards. But the button is always editable. Is there a difference with button controls?
Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    69,543 Most Valuable Professional on at
    The Displaymode setting for the button controls the state of the button.  Its either Edit, Disabled, or View.  If you physically add a button to the Canvas it will default to Displaymode.Edit.  But if you add a card that contains a button it may default to something else.  Setting the displaymode to reflect what is going on in the app is a common validation technique.  For example, a button will default to Displaymode.Disabled but when you fill in a specific required field the Displaymode is changed to Displaymode.Edit.  That changes whether the button can be pressed or not and also changes the way it looks.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
     
  • Suggested answer
    Vish WR Profile Picture
    3,507 on at
     

    To fix a button inside a Power Apps form card that stays active when it shouldn't, change the button's DisplayMode property to:
    Parent.DisplayMode
    Why this works: Manually added controls don't automatically inherit the form's state. Referencing Parent.DisplayMode forces the button to sync perfectly with the Edit, View, or Disabled mode of the container card and the overall form.
     
  • DB-22041341-0 Profile Picture
    17 on at
    So, my issue is that I need this button to disabled when I am in View mode and change to editable when users click the edit button. I have 3 other buttons that work fine and all have the card DisplayMode: DisplayMode.Edit and button DisplayMode:DisplayMode.Edit. This is how the other 3 buttons are set up and should work. I have tried to change my new button to DisplayMode: Parent.DisplayMode
    and button DisplayMode:Parent.DisplayMode, but this does nothing and the button is always editable. The card is within the form, and the form has not changed on the parent level so not sure how to get the button to behave like the other ones.
    ButtonDisplay.png
  • Suggested answer
    Pstork1 Profile Picture
    69,543 Most Valuable Professional on at
    Setting it to Parent.Displaymode will just reflect the displaymode of the card.  Since in your case that is set to edit it won't do anything.  Instead set a variable in the onSelect of the Edit button that stores a boolean showing that it was clicked.  Then use an IF() in the displaymode property of the button to set it to displaymode.Edit if that variable is true and displaymode.Disabled if the variable is false.  Make sure you default the variable to false when the app starts or the screen onVisible.  Make sure you make provision to set it back to false when you want it to be disabled again.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     

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 414

#2
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard