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 / gray out field based o...
Power Apps
Answered

gray out field based on value in another field

(0) ShareShare
ReportReport
Posted on by 576

I need to gray out a field and/or card based on the value in another field. For example, if field named Fuel Type has a value of Oil, I want field Amps to be grayed out.  How do I accomplish that? Is it through the DisplayMode property? What's the syntax for that?

 

thanks for the help.

Categories:
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @ahhollan 

    The Display mode property is the one to use. 

    It would be the name of the control in the Fuel Type card (say dropdown1)

    If(Dropdown1.Selected.Value = "Oil", Disabled, Edit)
  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    Use an IF() statement to check the value of the other field and set displayMode to disabled to grey out the field.  Something like this.

    if('Fuel Type'.value = "Oil",displaymode.disabled, displaymode.edit)

     

  • ahhollan Profile Picture
    576 on at

    Worked well. Thanks.  One more question, if I want to add multiple criteria to disable how would I do that?  say I want to do disable if the value is "Gas" or if the value was "Oil".

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    If(Dropdown1.Selected.Value = "Oil"||"Gas", Disabled, Edit)
  • ahhollan Profile Picture
    576 on at

    It works for the first value, but not the second.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @ahhollan 

    Try 

    If(Dropdown1.Selected.Value = OR("Oil","Gas"), Disabled, Edit)
  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    @Drrickryp Minor correction.  it should be

    If(Dropdown1.Selected.Value = "Oil"||Dropdown1.Selected.Value = "Gas", Disabled, Edit)

    You have to duplicate the whole formula, not just the right side value. 

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