Skip to main content

Notifications

Community site session details

Community site session details

Session Id : CRj3aPaHXklcK7fuACWF1W
Power Apps - Building Power Apps
Answered

How to enable/disable a button based on condition

Like (0) ShareShare
ReportReport
Posted on 21 Nov 2022 10:02:13 by 100

Good afternoon ,

I have 1 button and 1 icon.

when the first time if the  button is pressed , the button should be disabled .

the button should be enabled again when the icon is pressed.

please help me

  • Verified answer
    preethi1_suresh Profile Picture
    100 on 21 Nov 2022 at 11:37:18
    Re: How to enable/disable a button based on condition

    Thank you so much. It satisfied my need. thank a lot.

  • Verified answer
    cha_cha Profile Picture
    4,909 Super User 2025 Season 1 on 21 Nov 2022 at 10:17:21
    Re: How to enable/disable a button based on condition

    Hello @preethi1_suresh 

     

    On the loading of the screen set a context variable to True.

    cha_cha_0-1669025667579.png

     

    On the Button, set two properties:

    For OnSelect: UpdateContext({varEnabled: false});

    cha_cha_1-1669025710997.png

     

    For DisplayMode: If(varEnabled,DisplayMode.Edit,Disabled)

    cha_cha_2-1669025743623.png

     

    Then on the Icon:

    cha_cha_5-1669025810089.png

     

     

    Output should be like this:

    Recording #45.gif

     

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,679 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started