Can you change the Power Apps Toggle to the Radio button? Of course, Yes. This Power Apps tutorial will explain how to change Power Apps Toggle to Radio button.
Also, I will discuss how to convert the Toggle On/Off value to a Yes/No value in the Power Apps Radio button. Moreover, we will see how to change the value from toggle control to Radio control in the Power Apps Edit form.
Change a Toggle to a Radio Button in Power Apps
Here, I will take a simple scenario to change the Power Apps Toggle [On/Off] to the Radio Button [Yes/No] value. For that, follow the steps below:
- Set up a SharePoint list
- Create a blank Canvas app and add the SharePoint list data source connector
- Add Power Apps Edit Form and add the list data source
- Change the Power Apps Toggle control to the Radio button control
- Bind SharePoint Yes/No value in Power Apps Radio Button
- Save, Publish, and Preview the app
1. Set up a SharePoint list
- I have a SharePoint Online list named “Travel Requests“. This list contains the below columns.
|Column Name||Data Type|
|Trip Title||This is a Title column with a single line of text. I just renamed it to “Trip Title”|
|Travel Start Date||Date and time|
|Travel End Date||Date and time|
2. Create a blank Canvas app and add the SharePoint list data source connector
- Open Power Apps -> Create a blank canvas app -> Provide the App name, and by default, it will Format as Tablet, and click on the Create button.
- Once the Power Apps app is created, connect the SharePoint list, i.e., [Travel Requests], to the app. Once you connect, it will look like the screenshot below.
3. Add Power Apps Edit Form and add the list data source
- On the Power Apps Screen, insert the Edit form and connect the DataSource as a SharePoint list [‘Travel Requests’].
- Then, add the SharePoint list fields using the Edit Fields option as per the needs like below:
- Also, remember that whenever you want to add a new record from Power Apps to the SharePoint list, you should change Power Apps Form Default mode to “New” as shown below.
4. Change the Power Apps Toggle control to the Radio button control
- You can see here, in the Power Apps Edit form, the SharePoint Yes/No value as in Toggle control with On/Off value.
- Now, I don’t want to display the On/Off value in the Toggle control. I want to show the Yes/No value in the Radio button control.
- Whenever the user opens the Power Apps Edit form control, it will display the SharePoint Yes/No field in the Radio button.
- For that, select the Approved_DataCard1 -> Remove the Toggle button -> Insert a Radio button and set its Items property as:
Items = ["Yes", "No"]
5. Bind SharePoint Yes/No value in Power Apps Radio Button
- Next, Select the Approved_DataCard1 -> Set its Update property to the code below.
Update = If( Radio_Approved.Selected.Value = "Yes", true, false )
- If() = This Power Apps If() function to evaluate unrelated multiple conditions
- Radio_Approved = Power Apps Radio Button Name
- In the last, insert a Save Icon -> Set its Visible property code to the below.
Visible = If( Radio_Approved.Selected.Value = "Yes", true, false )
- Radio_Approved.Selected.Value= “Yes”,true,false = If Power Apps Radio button selected value is “Yes”, then only Button control will be appear
- Also, set the Save icon OnSelect property as:
OnSelect = SubmitForm(frm_NewTravelRequest); ResetForm(frm_NewTravelRequest)
- SubmitForm() = Use this function to save any changes in the Edit form control to the respective data source
- frm_NewTravelRequest = Power Apps Edit Form Name
- ResetForm() = This Function resets the contents of a form to their initial values
6. Save, Publish, and Preview the app
- Once your Power Apps app is ready, Save, Publish, and Preview the app.
- Whenever a user enters a new record, make sure he/she selects the Approved value as “Yes” in the Power Apps Radio button. Then, only the user will get the Save icon, or else it will be in disappear mode.
- Once click on the Save icon, the new record will be added to the SharePoint list.
Refer to the below screenshot:
This is all about how to change the Power Apps Toggle On/Off value to the Radio button Yes/No value.
This Power Apps tutorial taught us how to change a Toggle value to a Radio button value in Power Apps.
Here, we discussed converting the Toggle On/Off value to a Yes/No value in the Power Apps Radio button. Also, we covered how to change the value from toggle control to Radio control in the Power Apps Edit form using an example.
You may also like:
- How to Convert Dropdown to Radio Button in Power Apps Form?
- Get Radio Button Selected Value in Power Apps
- Change the Radio Button Layout from Vertical to Horizontal in Power Apps
- If Statement in Power Apps Radio Button
- How to Set Radio Button Default Value in Power Apps?
- How to Filter Gallery By Radio Button in Power Apps?
Preeti Sahu is an expert in Power Apps and has more than 6 years of experience working with SharePoint and the Power Platform. As a Power Platform expert for Power BI, Power Apps, Power Automate, Power Virtual Agents, and Power Pages, she is currently employed with TSinfo Technologies. She is the author of the book Microsoft Power Platform A Deep Dive. She also made a big technical contribution to SharePointDotNet.com in the form of articles on the Power Platform. She enjoys traveling and spending time with her family in her spare time.