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 fields ...
Power Apps
Answered

How to disable fields based on another's value

(0) ShareShare
ReportReport
Posted on by 75

HI,

 

I am trying to get all the red toggles/data cards within this form to go disabled when i switch the machine in use one to no.

Rogan_0-1686307712922.png

All help appreciated!

Categories:
I have the same question (0)
  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    To disable fields based on the value of another field in a canvas app form, you can use the following steps:

    1. Identify the field whose value will determine the disabling/enabling of other fields. Let's call this field "MachineInUse".

    2. For each field that you want to disable when "MachineInUse" is set to "No", follow these steps:

      a. Select the field you want to disable.

      b. In the properties pane, look for the "Visible" or "Enabled" property, depending on the type of control you are using.

      c. Click on the property and switch its value to the following formula: 

     

    If(MachineInUse.Value = "No", false, true)​

     

    • This formula checks if the value of the "MachineInUse" field is "No". If it is, the formula returns false, which disables the field. If it's any other value, the formula returns true, enabling the field.

      d. Repeat these steps for each field you want to disable.

    • Save your changes and test the form. Now, when the "MachineInUse" field is set to "No", the other fields should be disabled, and when it's set to any other value, the fields should be enabled.

    Note: The exact steps may vary depending on the canvas app development platform you are using, but the concept of using a formula to conditionally disable fields remains the same.

  • SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @Rogan ,

     

    Select the Data card or DataCardValue from the left pane , which you want to disable and write the formula in the DisplayMode property of the control.

     

    Lets say you want to disable a field based on MachineStatus column , then use the below formula, 

     

    If(MachineStatus.Selected.Value="On",DisplayMode.Edit,DisplayMode.Disabled)

     

    Please use DataCardValue property from the DataCard while you are disabling the field.

     

    If this helps please give it  a thumbs up and accept it as a solution.

     

    Thanks,

  • Rogan Profile Picture
    75 on at

    These are the options i get after i type if.

    Rogan_0-1686308446973.png

    which do i want? Neither seem to like it when i put .Value after them.

  • SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @Rogan  ,

     

    Please search for the field based on which you want to disable other fields from the left side (In Tree View and Get the DataCardValue controlname) and then write this formla.

     

    Thanks,

  • Rogan Profile Picture
    75 on at

    ok i Wrote that formula but now i have the yellow triangle error and it is constantly disabled?

    Rogan_0-1686309198941.png

     

  • Verified answer
    SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @Rogan  ,

     

    I think your column is of type Boolean in SharePoint. Please use the formula as below. I think there is a type mismatch error.(Incompatible types for Comparison Error).

     

    My toggle Control Name is DataCardvalue5 , use your toggle control Name instead in the below formula.

     

     

    If(DataCardValue5.Value=true,DisplayMode.Edit,DisplayMode.Disabled)

     

    Below images are for your reference. 

     

    Please give this a thumbs up if this helps and accept this as a solution.

     

    Thanks,

    ToggleDisableEable2.png
    ToggleContolDisable1.png
  • Rogan Profile Picture
    75 on at

    This works! thank you very much! @SanmeshG 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 915

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 457

Last 30 days Overall leaderboard