The PowerApps Toggle control functions similarly to a checkbox, allowing users to turn it on or off using its handle. The Toggle control in PowerApps is essentially a switch control. By utilizing this control, users can easily toggle the switch on or off by interacting with its handle.
The Toggle control in PowerApps provides a visual representation of a binary state, where it can be in either an "on" or "off" position. When the Toggle control is in the "on" position, it signifies that a particular setting, feature, or action is enabled. Conversely, when the Toggle control is in the "off" position, it indicates that the setting, feature, or action is disabled.
To use the Toggle control in PowerApps, you can simply add it to your app's user interface. Users can interact with the control by clicking or tapping on its handle, which is the small circular knob typically positioned on the switch. Clicking or tapping the handle will toggle the state of the control between "on" and "off".
In this article, we will guide you on how to add PowerApps Toggle and how to control it.
How to add Toggle to your PowerApps
Follow the below steps to add a toggle to your PowerApps screen:
STEP 1: Open the PowerApps form and go to the "Insert" tab.
STEP 2: Now, click on "Input" and select "Toggle". This will add the toggle switch control to your PowerApps screen.
STEP 3: You can also add label input control. For that go to Insert => Label.
STEP 4: Now, you have to set the condition formula in the label control to display the specific value.
STEP 5: If you want to rename the Toggle switch, click on "More Options (...) and select "rename".
STEP 6: Here, I have renamed it as "PowerApps Discount".
STEP 7: Apply the following formula to the text property of the label control.
Text = If('Powerapps Course Discount'.Value = true, "Price: $100", "Price: $500")
In the above condition, when you will switch on the toggle the price will be $100 and when switch off the toggle the price will be $500.
Here we have another example.
Text = If('PowerApps Discount'.Value = true, "Toggle is ON", "Toggle is OFF")
In the above condition, when you will switch on the toggle, it will show "Toggle is ON" and when you will switch off the toggle, it will show "Toggle is OFF."
STEP 8: Save and publish your PowerApps App.
STEP 9: You can preview the app by pressing the F5 button.
PowerApps toggle control Properties
Here are the important properties of the PowerApps Toggle which provide control over the appearance and behavior of the PowerApps Toggle, allowing customization and defining how the app responds to user interactions and changes in the toggle's state.:
BorderColor: Specifies the color of the control's border.
DisplayMode: Determines whether the control is in Edit mode, View mode, or Disabled mode.
DisabledBorderColor: If the control's DisplayMode property is set to Disabled, this property defines the color of the control's border.
FalseFill: Sets the color of the toggle when it is in the "off" position.
FalseHoverFill: Defines the color of the toggle when it is being hovered over and in the "off" position.
FalseText: Specifies the text value to be displayed when the toggle switch is in the "off" position.
Fill: Determines the background color of the toggle control.
HandleFill: Sets the color of the toggle handle.
OnChange: Specifies the app's response when the user changes the value of the control.
OnCheck: Defines the app's response when the toggle value changes to true (when the toggle is turned on).
OnSelect: Specifies how the app responds when the user interacts with the control (e.g., clicks or taps on it).
OnUncheck: Defines the app's response when the toggle value changes to false (when the toggle is turned off).
Reset: Allows the control to revert to its default value.
TrueFill: Sets the color of the toggle when it is in the "on" position.
TrueHoverFill: Defines the color of the toggle when it is being hovered over and in the "on" position.
TrueText: Specifies the text value to be displayed when the toggle switch is in the "on" position.
Visible: Determines whether the toggle switch control is displayed or hidden.
The "PowerApps Toggle" control is a versatile tool that allows users to toggle between a "Yes" or "No" state within a PowerApps application. It provides a user-friendly way to capture and display binary data or boolean values.
The PowerApps Toggle control is typically used in scenarios where you need to present a binary choice or switch-like functionality. It can be utilized in various applications, such as forms, surveys, data entry screens, or any situation where a simple yes or no input is required.