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 / Disabling a button?
Power Apps
Answered

Disabling a button?

(0) ShareShare
ReportReport
Posted on by 58

Greetings,

 

I'm having an issue with trying to make a button become disabled after it's been pressed once. I tried following the solution in this post but it simply doesn't work. I get "error token" under the button's name in the OnSelect field. I feel like the way one disables a control changed since then.

 

What I need is once the button was pressed, run a process which works and then disable itself. Right now it runs fine, but the disabling part doesn't work...it keeps the button up there.

 

Any help is greatly appreciated!

Categories:
  • Jason_Hough Profile Picture
    119 on at

    On the displayType put a variable in that, and onSelect on the button execute an UpdateContext on the variable you enabled on displayType - should work ok. 

  • Daemetius Profile Picture
    58 on at

    @Jason_Hough wrote:

    On the displayType put a variable in that, and onSelect on the button execute an UpdateContext on the variable you enabled on displayType - should work ok. 


    I'm a bit confused on what you mean. When you say "On the displayType put a variable in that..." you refer to the button? 

  • Verified answer
    Jason_Hough Profile Picture
    119 on at

    Display Mode set to DisplayMode.Disabled will grey out your button. So on the OnSelect of the button use UpdateContext ({DisplayMode : DisplayMode.Disabled}) (or sometihng like that) and then put that variable in this exanple 'DisplayMode' in DisplayMode advanced setting on the button properties - this should work fine. I will quickly test and send you accurate code later on if that will help

  • Daemetius Profile Picture
    58 on at

    @Jason_Hough wrote:

    Display Mode set to DisplayMode.Disabled will grey out your button. So on the OnSelect of the button use UpdateContext ({DisplayMode : DisplayMode.Disabled}) (or sometihng like that) and then put that variable in this exanple 'DisplayMode' in DisplayMode advanced setting on the button properties - this should work fine. I will quickly test and send you accurate code later on if that will help


    Worked like a charm! 

     

    Although I'm curious. Is there way to have such button disabled for only a specific record of a list? I noticed it disables the button for all items in a list

     

    So I have the button in the "Detail Screen". So if I have:

    List

     

    Item A

    Item B

    Item C

     

    When I click Item A, the button is there. I press it and it is disabled. 

    Now If I go to Item B Detail Screen, the button is still grayed out. I was wondering if it's possible to have it enabled  and have the same process for that item only? 

     

    Thank you again for your help on the button matter! 

  • Daemetius Profile Picture
    58 on at
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Have you found a way to fix it? I have the same issue here 

  • lunstrum Profile Picture
    5 on at

    I'm looking for this solution also. If you've solved your issue, can you repost the exact steps for us? Thank you!

  • Sajarac Profile Picture
    3,295 on at

    Hi there. I am following this post but I can not get my button to achive the same effect.

     

    I have a button "SAVE" and I would like once the button completed the action enable a second button "ADD Photos"

     

    Any advise please?

     

    Capture.PNGIf(!IsBlank(NewAddressText.Text)&&!IsBlank(NewCityText.Text)&&!IsBlank(NewZipText.Text)&&!IsBlank(NewStateText.Text)&&!IsBlank(NewTitleText.Text)&&!IsBlank(NewSubTitleText.Text)||!IsBlank(NewTitleText.Text)&&!IsBlank(NewSubTitleText.Text)&&Radio1_4.Selected.Value="Use GPS for current Location",
    UpdateContext({AddRecord:Patch(SiteInspector,Defaults(SiteInspector),{ID:Max(SiteInspector,ID)+1,Title:NewTitleText.Text,SubTitle:NewSubTitleText.Text,Notes:NewNotesText.Text,Description:NewDescriptionText.Text,Address:NewAddressText.Text,City:NewCityText.Text,Zip:Text(NewZipText.Text),State:NewStateText.Text,Latitude:If(Radio1_4.Selected.Value="Use GPS for current Location",Text(Location.Latitude),""),Longitude:If(Radio1_4.Selected.Value="Use GPS for current Location",Text(Location.Longitude) ,""),IsGPSCoordinates:If(Radio1_4.Selected.Value="Use GPS for current Location","True","False")})});UpdateContext(ButtonADDPhotos.enable));If(IsBlank(NewTitleText.Text)||IsBlank(NewSubTitleText.Text)||IsBlank(NewAddressText.Text)||IsBlank(NewCityText.Text)||IsBlank(NewStateText.Text)||IsBlank(NewZipText.Text) ,UpdateContext({Required:true}),UpdateContext({Required:false}))

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Where you able to get this sorted out, im currently having the same issue and tried to work around it but found that there are other issues like for instance the state of the gallery.isselected is not consistent when the form loads thus causing issue for my work aroundPWA.PNGPWA2.PNG

  • Sajarac Profile Picture
    3,295 on at

    Nothing yet, and I just give up with that form.

     

    Sorry

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 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard