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 / Enable a Disabled butt...
Power Apps
Answered

Enable a Disabled button with onselect

(0) ShareShare
ReportReport
Posted on by 118

When the form loads, the Update button Display mode is Disabled. I want to make it in Active only when I click on Edit button. The code I am using is not functioning.

 

Appreciate a quick help!!

Dispaly ModeEdit.png
DisplayModeDisabled.png
Categories:
  • Verified answer
    eka24 Profile Picture
    20,925 on at

    Try this;

    Onvisible of the screen Set a variable;

    Set(ButtonnMode,false)

     

    Then on the Edit Button, change the formula to;

    EditForm (Form1_2); Set(ButtonnMode,true)

     

    Then on the Displaymode of the Update button put;

    If(ButtonnMode=true, DisplayMode.Edit, DisplayMode.Disabled)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @shoebwk 

    Can you try to update the configuration to below expressions?

    Edit Button: OnSelect -> EditForm(FormName);Set(DisableButton,false)

    Disable Button -> OnSelect -> /*Actions on button*/;Set(DisableButton,true)

    DisplayMode -> If(!DisableButton, DisplayMode.Edit, DisplayMode.Disabled)

    Screen -> OnVisible -> Set(DisableButton,true)

     

    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!

  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    Hi @shoebwk ,

     

    I agree with both @eka24 and @yashag2255 but I don't suggest you create a global variable for just setting the button availability. In PowerApp Set create a variable and the scope of that variable is across the forms (entire APP) so the best approach is create a local variable to that form with updateContext as follows:

    Edit Button: OnSelect -> EditForm(FormName);UpdateContext({DisableButton:true})
    
    DisplayMode -> If(DisableButton, DisplayMode.Edit, DisplayMode.Disabled)
    
    Update Button -> OnSelect -> UpdateContext({DisableButton:false}) // this is to disable button while you are updating the details to DataSource

    See the below detailed just 5 min video created by MVP @aprildunnam  explaining about variables and how we should use in PowerApps.
    https://www.youtube.com/watch?v=yYqrUpCH1Ao&t=16s

     

    Again, the above 2 solutions 100% works it is only about the best practices and improving the App performance on the long run.


    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • kamarge Profile Picture
    13 on at

    Yes, This worked for me. Thank you.

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
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard