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 / How to Disable Control...
Power Apps
Answered

How to Disable Controls if Status equals some text.

(0) ShareShare
ReportReport
Posted on by 395

I am converting a form over from InfoPath to PowerApps. In InfoPath there is an option to Disable Control if the status box equals some text. What would be the best way to do this in PowerApps.

Screenshot 2024-04-02 134457.png

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @lbolin - you will need to leverage the DisplayMode property of the control you're using.

     

    For example, suppose we want to disable a Button control based on whether the selected value from a Dropdown control contains either of your Status options, we can apply the below to the DisplayMode property:

     

    If(
     Dropdown1.Selected.Value in [
     "Pending Bid Waiver",
     "Pending CAR Approved",
     "CANCELLED"
     ],
     DisplayMode.Disabled,
     DisplayMode.Edit
    )

     

     

    Further reading:

     

    https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/properties-core 

  • Trout19 Profile Picture
    395 on at

    I have everything in data cards. So this is the code i used

    If(StatusValue.Value = "Pending Bid Waiver Approvals" || StatusValue.Value ="Pending CAR Approvals"||StatusValue.Value = "CANCELLED",DisplayMode.View,Parent.DisplayMode)

    I haven't been able to test it quite yet. 

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @lbolin - ok. Do you have a question?

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @lbolin  - your code is fine btw. It will produce the same result as the code I suggested.

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 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard