web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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,

  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard