LowCodeGo logo

Disable Fields on Condition in Canvas Apps

Overview

In this tutorial, we will review how fields can be disabled based on user entering data in a drop down, toggle, date picker, numeric text input and regular text input.

YouTube

Drop Down

Dataverse Option Set

If you’re using a Dataverse option set in your dropdown, you will need to perform the following:

  1. Select the control you want to disable
  2. Select the DisplayMode property
  3. In the formula window, compare the selected value of the drop down to the Dataverse option set value

Note – It may be tricky to find the correct Option set value from Dataverse. If this is the case, copy it from the Items property of the dropdown

If(dropdown_Status_DV.Selected.Value = 'Account Status Optionset'.Cancelled, DisplayMode.Edit, DisplayMode.Disabled)

Local Collection Option Set

If you’re using a local collection for your drop down options, you will need to perform the following:

  1. Select the control you want to disable
  2. Select the DisplayMode property
  3. In the formula window, compare text value of the local collection
If(dropdown_Status_LC.Selected.Description = "Cancelled", DisplayMode.Edit, DisplayMode.Disabled)
dropdown disabled control

Toggle

If you’re comparing against a Toggle to disable controls in your app, you will need to perform the following:

  1. Select the control you want to disable
  2. Select the DisplayMode property
  3. In the formula window, the If condition will only need the true or false value of the toggle to disable ex) toggle.Value = true or !toggle.Value = false
If(tgl_Status.Value, DisplayMode.Disabled, DisplayMode.Edit)
toggle disabled control

Date Picker

If you’re comparing against a Date Picker to disable controls in your app, you will need to perform the following:

  1. Select the control you want to disable
  2. Select the DisplayMode property
  3. In the formula window, you can compare against a date range if you wish ex) date prior to today is selected
If(date_Selection.SelectedDate < Today(), DisplayMode.Edit, DisplayMode.Disabled)
date picker disabled control

Numeric Text Input

If you’re comparing against a text input that only accepts numeric values, you will need to perform the following:

  1. Select the control you want to disable
  2. Select the DisplayMode property
  3. In the formula window, you can compare against a numeric range ex) numeric value is above a certain amount
If(Value(text_Number_Input.Text) > 10, DisplayMode.Edit, DisplayMode.Disabled)
numeric text input disabled control

Standard Text Input

If you’re comparing against a standard text input, you will need to perform the following:

  1. Select the control you want to disable
  2. Select the DisplayMode property
  3. In the formula window, you can compare against a text value
If(text_Input.Text = "Cancelled", DisplayMode.Edit, DisplayMode.Disabled)
standard text input disabled control

Leave a Reply

Categories

Follow us

Copyright ©LowCodeGo 2025

Discover more from LowCodeGo

Subscribe now to keep reading and get access to the full archive.

Continue reading