How to Use Power Apps Toggle Control + Examples

In this Power Apps tutorial, I will explain the Power Apps Toggle control, its key properties, and how to use it with examples.

We will also discuss how to save a Power Apps toggle value in a SharePoint list and how to change the toggle to a radio button control.

Power Apps Toggle Control

In Power Apps, the toggle control is used as a switch. Users can quickly turn it on or off by moving its handle. A PowerApps Toggle control operates similarly to a checkbox.

Enabling the “ShowLabel” option to “true” so that users can quickly determine the toggle value.

Power Apps toggle value

This is the overview of the Power Apps Toggle control.

Power Apps Toggle Control Properties

Here, I will explain the properties of Power Apps toggle control.

Property NameDescription
AccessibleLabelThis property is assigned to a screen reader label.
Border ColorA user can specify the color for a border.
Border StyleThis property specifies the type of border that the control should have [“Solid,” “Dashed,” “Dotted,” “None”].
DefaultWhen the user opens the app, we can specify the value to be yes or no.
DisabledBorderColorWhen the DisplayMode property of the control is set to Disabled, it indicates a color for the control’s border.
DisplayModeDetermines whether it enables user input (Edit), only displays data (View), or is disabled (Disabled).
FalseFillWhen the toggle switch control is in the off position, it fills with color.
FalseHoverFillWhen the Toggle switch control is turned off, the toggle hover gets filled with color.
FalseTextThe text to display when the toggle is turned off.
HandleFillWe can provide the color to the toggle handle.
OnChangeWhen the user changes a value, it specifies what action to perform.
OnCheckOnce the toggle value changes to true, it determines the app’s response.
OnSelectWhen the user clicks on a control, it specifies what action to perform.
OnUncheckOnce the toggle value changes to false, it determines the app’s response.
ResetResetting the controls to their default value can be beneficial.
TrueFillWhen the toggle is switched on, the color is filled.
TrueHoverFillIf the toggle switch is activated, the toggle hover will be filled with color
TrueTextDisplaying the text value while the toggle switch is on.
VisibleHere, we can specify whether the toggle control can be visible.

These are the properties of a Power Apps toggle control.

Add Power Apps Toggle Control

Here, I will show you how to insert a toggle control in the Power Apps canvas app:

  • On the Power Apps screen, insert a Toggle control.[Click on +Insert -> Expand Input -> Select Toggle].
Power Apps toggle control
  • By default, the toggle control name will be “Toggle1“; you can Rename it using “tgl” based on your requirement.
Power Apps toggle control properties

This is how we can insert a Power Apps toggle control.

How to Use Power Apps Toggle Control

This section will show you how to use a Power Apps toggle control.

Example:

I will display the text label based on the toggle switch set to On or Off. When the toggle is turned On, the label displays Approved; when turned Off, it shows Not Approved.

the file is not digitally signed powershell script

Follow the below steps to achieve this:

  • On the Power Apps screen, insert the Toggle control and set its properties as shown below:
TrueText = "On"
FalseText = "Off"
How to add Power Apps toggle control
  • Now, I will rename the toggle switch to “tgl_IsApproval” as shown below:
Add Power Apps toggle control
  • Insert a Text label -> Set its Text property to the code below:
If(
    tgl_IsApproval.Value = true,
    "Approved",
    "Not Approved"
)

Where,

  1. tgl_IsApproval = Toggle control name
  2. Approved = To display this text when the toggle switch is On
  3. Not Approved = To display this text when the toggle switch is Off
Toggle control in Power Apps
  • Once the app is ready, SavePublish, and Preview the app. The text label will display based on the toggle switch set to On or Off.
How to use toggle control in Power Apps

This is how we can use the Power Apps toggle control.

Save Power Apps Toggle Value in a SharePoint List

In this example, I will show you how to save the Power Apps toggle value to the SharePoint list.

For Example, I have a SharePoint list [Product List] that has various columns like:

Column NameData Type
ProductTitle
Product Is AvailableYes/no
PowerApps Toggle using SharePoint List

On my Power Apps screen, I have added an Edit form connected to the above SharePoint list. The form contains the Toggle control, which is connected to the SharePoint list “Yes/no” column [Product Is Available].

Later, I added a Button control to the Power Apps form below. When a user toggles the value to Yes/No using the toggle control and clicks the [Submit] button, the data is saved in the SharePoint list.

get logged in user count in SharePoint

The provided data will be displayed on the SharePoint list.

How to use the PowerApps Toggle SharePoint List

Follow the below steps to achieve it:

  • On the Power Apps screen, insert an Edit form. Then, add a new data source for the above SharePoint list and set the Edit form’s Data source property:
'Product Details'

Where,

  • Product Details = SharePoint list name
Power Apps Toggle Yes or No
  • Insert a Button control -> Set its OnSelect property to:
Patch(
    'Product List',
    Defaults('Product List'),
    {
        Title: DataCardValue3.Text,
        'Product Is Available': DataCardValue8.Value
    }
)

Where,

  1. Product Details = SharePoint list name
  2. Title = SharePoint list title column
  3. DataCardValue3 = Text-input control name
  4. Product Is Available = SharePoint list yes/no column name.
  5. DataCardValue8 = Toggle control name
How to use toggle with SharePoint list in Power Apps
  • Once the app is ready, savePublish, and Preview it. Whenever the user switches the value to Yes/No using the toggle control and clicks the button [Submit].
Use Power Apps toggle with SharePoint List

The provided data will be displayed on the SharePoint list.

How to Use Power Apps Toggle With SharePoint List

I achieved this by saving the Power Apps toggle control value to SharePoint.

How to Change Power Apps Toggle to Radio Button

In this section, I will take a simple scenario to replace the Power Apps Toggle [On/Off] Radio Button [Yes/No] value. For that, follow the steps below:

  1. Add a Power Apps Edit Form and connect the SharePoint list as a data source.
  2. Replace the Power Apps Toggle control with the Radio button control.
  3. Save the Radio button value to the SharePoint list.

For Example, I have a SharePoint Online list named “Travel Requests“ that has various columns like:

Column NameData Type
Trip TitleThis is a Title column with a single line of text. I just renamed it to “Trip Title.”
DestinationLocation
Travel Start DateDate and time
Travel End DateDate and time
ApprovedYes/No
Change Power Apps Toggle to Radio Button

Step 1: Add a Power Apps Edit Form and connect the SharePoint list as a data source

Change Power Apps Toggle Value to Radio Button Value
  • On the Power Apps Screen, insert an Edit form -> Set its DataSource property to:
'Travel Requests'

Where,

  1. Travel Requests = SharePoint list name
Change the Power Apps Toggle On Off value to Radio button Yes No value
  • In the Power Apps Edit form, the SharePoint Yes/No column value can be represented through a Toggle control that displays an On/Off value.
Change Power Apps Toggle control to Radio button control

Now, let’s check how to replace the toggle control with a radio button control.

Step 2: Replace the Power Apps Toggle control with the Radio button control

  • On the Power Apps Edit form, select the Approved_DataCard1 -> Remove the Toggle button -> Insert a Radio button -> Set its Items property to:
["Yes", "No"]
Replace the Power Apps Toggle control with the Radio button control
  • Next, Select the Approved_DataCard1 -> Set its Update property to the code below.
If(
    Radio_Approved.Selected.Value = "Yes",
    true,
    false
)

Where,

  1. Radio_Approved = Power Apps Radio Button control name
How to replace the Power Apps Toggle control with the Radio button control

I replaced the toggle control with a radio button; let’s check how to save the user-selected item to a SharePoint list.

Step 3: Save the Radio button value to the SharePoint list

  • On the Power Apps screen, Insert a Save icon -> Set its OnSelect property to:
SubmitForm(frm_NewTravelRequest);
ResetForm(frm_NewTravelRequest)
Power Apps replace Toggle control with Radio button control

Where,

  1. frm_NewTravelRequest = Power Apps Edit Form Name
How to Bind a SharePoint Yes No value in Power Apps Radio Button
  • Once your Power Apps app is ready, Save, Publish, and Preview the app whenever the users provide the value as “Yes”/ “No” in the Power Apps Radio button. Then click on the Save icon.
  • That record will be saved to the SharePoint list as shown below:
Replace Toggle control with Radio button control in Power Apps

This is all about replacing the Power Apps Toggle On/Off value with the Radio button Yes/No value.

Conclusion

I hope this article helped you understand the Power Apps toggle control, its various properties, and how to use a toggle in a Power Apps canvas application.

Additionally, we learned how to save a Power Apps toggle value in a SharePoint list and convert a toggle button to a radio button in Power Apps, with examples.

Also, you may like some more Power Apps articles:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…