Skip to main content

Command Palette

Search for a command to run...

Disabling a field after selecting checkbox in power apps

Published
1 min read
Disabling a field after selecting checkbox in power apps
A

I am a seasoned software developer with extensive experience in multiple programming languages and technologies. With a strong understanding of software design principles and a track record of delivering high-quality products, I have a passion for mentoring and helping others grow in their careers. My expertise and experience make me an excellent resource for those seeking guidance and support in the software development field. Whether you're just starting out or looking to take your skills to the next level, I'm here to help.

To disable a field after selecting a checkbox in Power Apps, you can use the "OnChange" property of the checkbox control.

Here's an example:

  1. Add a checkbox control to your form, and name it "Checkbox1".

  2. Add the field that you want to disable, and name it "Field1".

  3. Select the "Checkbox1" control, and go to the "Advanced" tab in the right-hand pane.

  4. Click on the "OnChange" property, and select "Edit".

  5. In the formula bar, type the following formula:

    If(Checkbox1.Value=true, Set(DisableField1, true), Set(DisableField1, false))

    This formula checks whether the checkbox is selected. If it is, it sets a variable called "DisableField1" to true. Otherwise, it sets the variable to false.

  6. Select the "Field1" control, and go to the "Advanced" tab.

  7. Click on the "DisplayMode" property, and select "Edit".

  8. In the formula bar, type the following formula:

    If(DisableField1=true, DisplayMode.Disabled, DisplayMode.Edit)

    This formula checks the value of the "DisableField1" variable. If it is true, it sets the display mode of the "Field1" control to "Disabled". Otherwise, it sets the display mode to "Edit".

Now, when the user selects the checkbox, the "Field1" control will be disabled.

More from this blog

AK's Tech Space

49 posts

Hey there! Welcome to my Technology and Self-Improvement blog. Here, I'll be sharing all the latest in technology and programming, as well as tips for personal growth. Let's learn and grow together!