Working With RadioButton Control In Microsoft PowerApps

Introduction

Before reading this article, please go through the articles mentioned below.

In PowerApps, we can add the RadioButton control.

RadioButton

RadioButton enables the user to select a single option from a group of choices when paired with other RadioButton controls. When a user clicks on one RadioButton, it becomes checked and all other RadioButtons in the same group become unchecked.

Follow the steps, mentioned below to work with RadioButton in PowerApps.

Step 1. Log in to the PowerApps

After downloading PowerApps from the Windows store, we need a Microsoft-related organization’s Office 365 ID (MSDN, Microsoft, Skype, Office 365, etc.,) to login with.

 PowerApps

Step 2. Create a New App in PowerApp.

After login, we can see the dashboard. Subsequently, we click on the New button.

 New App

Step 3. Choose the Blank app.

Blank app

Step 4. Designing the App

Now, let's start designing the app. On the left side, we can see the individual screens to add our data. On the right side, we see the list of layouts. On the top, we see the formula bar, where you can see the Properties of the screen, which are selected by you. On the right side, we see the Add DataSource to add the external DataSource.

Designing the App

Step 5. Drag and Drop the Radio Button Control.

  1. Go to the Insert menu and drag the RadioButton tool.
    Button Control
  2. Drop the RadioButton tool on the screen.
     RadioButton
  3. Rename the MyRadioBtn.
    MyRadioBtn
  4. Add the options.
  5. Select the RadioButton and add the options for the RadioButton to the Item event.
     Item event

Step 6. Drag and Drop the Shape Control Tool.

If you select the options, the changes appear on the Shape.

  1. Go to the Insert menu, choose Icons, and drag the 5-point Star Shape.
    Star Shape
  2. Draw the Shape control on the screen.
    Shape control
  3. Add the coding.
  4. Select the Shape control and add the coding to the Fill event.
  5. Coding
    If(
        MyRadioBtn.Selected.Value = "Red", RGBA(192, 0, 0, 1),
        MyRadioBtn.Selected.Value = "Green", RGBA(0, 176, 80, 1),
        MyRadioBtn.Selected.Value = "Blue", RGBA(0, 32, 96, 1)
    )
    
    Fill event

Step 7. Run the app.

Run the app

Output 1. The Main Screen looks as follows.

Main Screen

Output 2. Click on the Red Option.

Red Option

Output 3. Click on the Green Option

 Green Option

Output 4. Click on the Blue Option.

Blue Option

Conclusion

I hope you understand how to add RadioButton control in Microsoft PowerApps and how to run it.


Similar Articles