Skip to main content

Notifications

Community site session details

Community site session details

Session Id : kxWd5O2FfXryB9GXvnc+7w
Power Apps - Building Power Apps
Answered

How to disable fields based on another's value

Like (0) ShareShare
ReportReport
Posted on 9 Jun 2023 10:49:08 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!

  • Rogan Profile Picture
    75 on 12 Jun 2023 at 07:36:57
    Re: How to disable fields based on another's value

    This works! thank you very much! @SanmeshG 

  • Verified answer
    SanmeshG Profile Picture
    1,938 Super User 2025 Season 1 on 09 Jun 2023 at 13:12:53
    Re: How to disable fields based on another's value

    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 09 Jun 2023 at 11:13:26
    Re: How to disable fields based on another's value

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

    Rogan_0-1686309198941.png

     

  • SanmeshG Profile Picture
    1,938 Super User 2025 Season 1 on 09 Jun 2023 at 11:05:05
    Re: How to disable fields based on another's value

    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 09 Jun 2023 at 11:01:24
    Re: How to disable fields based on another's value

    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,938 Super User 2025 Season 1 on 09 Jun 2023 at 10:58:10
    Re: How to disable fields based on another's value

    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,

  • Shaheer Ahmad Profile Picture
    2,194 Super User 2025 Season 1 on 09 Jun 2023 at 10:51:35
    Re: How to disable fields based on another's value

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard
Loading started