How to Make Power Apps Radio Button Field Mandatory?

Are you looking forward to learning how to make a Power Apps Radio button field mandatory? In this Power Apps tutorial, I will make the Power Apps radio button field mandatory.

Also, we will discuss how to notify the warning message based on the Power Apps Radio button validation.

Moreover, we will see how to validate the Power Apps Save icon based on the Radio button selection and validate the Power Apps other fields based on the Radio button selected value.

Make Power Apps Radio Button Field Mandatory

Let’s see how to make a Power Apps Radio button field mandatory with a simple scenario.

Scenario:

1. I have a SharePoint Online list, i.e., [Travel Requests], and inside this, I have added various columns with different data types.

Column NameData Type
Trip TitleDefault single line of text
DestinationLocation
AirlineChoice
ApprovedYes/No
Power Apps Radio Button Mandatory

2. In Power Apps, I created an Edit form connected to my SharePoint list. Now, I want to make the Radio button field [Approved] mandatory, as in the screenshot below.

Power Apps Radio Button Control Mandatory

3. Also, whenever the user doesn’t select any value from the Radio button, he/she will get the warning message [Select the value] like below.

How to Make a Power Apps Radio Button Mandatory

To work around this, follow the steps below. Such as:

4. Open Power Apps -> Create Blank canvas app -> Connect the SharePoint list to the app.

How to Make the Power Apps Radio Button Mandatory

5. On the Power Apps Screen -> Insert an Edit Form and set its Items property as:

Items = 'Travel Requests'

Where,

  • ‘Travel Requests’ = SharePoint Online List
powerapps radio button required field validation

6. Now, select the Approved_DataCard1 -> Go to the Advanced options -> Set its Required property as “true” like below.

How to make powerapps field mandatory on radio button selection

7. Then, select the Radio button and set its OnChange property to the code below.

OnChange = If(
    IsBlank(Radio_Approved.Selected.Value),
    UpdateContext({ErrMessage: true}),
    UpdateContext({ErrMessage: false})
)

Where,

  • Radio_Approved = Power Apps Radio Button Name
  • UpdateContext() = This function is used to create a context variable
  • ErrMessage = Context Variable Name
Make powerapps field mandatory on radio button selection

8. Now, select the ErrorMessageLabel and set its Text and Visible properties as shown below.

Text = "Select the value"    //Text Value

Visible = ErrMessage         //Variable Name
Make a Power Apps Radio Button Mandatory

9. Once your app is ready, Save, Publish, and Preview the app. Whenever the user opens the Power Apps form, it will make the Radio button field required and notify the error message until any value is selected in the Radio button.

How to Make a Power Apps Radio Button Mandatory

This is how to make the Power Apps Radio button field mandatory.

Make Power Apps Radio Button Validations

Here, we will discuss how to make the Power Apps Radio button validations with simple examples. Such as:

  • How to validate Power Apps Save icon based on Radio button selection
  • Validate other Power Apps fields based on Radio button selected value

Validate Power Apps Save Icon Based on Radio Button Selection

Let’s take a simple scenario: I have a SharePoint Online list named “Employee Task List”. This list contains the below fields.

Column NameData Type
TaskDefault single line of text
Employee NameA single line of text
StatusChoice
Start dateDate and time
Due DateDate and time
Power Apps Radio Button Control Validation

In Power Apps, I have an Edit form that is connected to the above SharePoint list. Whenever the user selects any value from the Radio button, the Save icon will appear, or else it will disappear, as in the screenshot below.

Powerapps Radio Button selected validation

To do so, follow the below steps.

1. On the Power Apps Screen -> Select the Edit form -> Choose the Save icon and set its Visible property as:

Visible = If(
    !IsBlank(Radio_Status.Selected.Value),
    true,
    false
)

Where,

  • If() = This Power Apps If() function evaluates the unrelated conditions
  • Radio_Status = Power Apps Radio Button Name
Power Apps Radio Button Validations

2. Save, Publish, and Preview the app. When the user enters a new record, he/she should select any value from the Radio button; only then will the Save icon appear, or else it will be in disable mode, as shown below.

Validate Power Apps Save Icon Based on Radio Button Selection

This is how to validate the Power Apps Save icon based on the Radio button selection.

Validate Other Power Apps Fields Based on Radio Button Selected Value

In the last, we will see how to validate other Power Apps fields based on the Radio button selected value.

Example:

I will also take the above SharePoint list [Employee Task List] for this example. When a user selects a specific value [Not Started] from the Radio button, he/she will get Reason_DataCard1, or else it will be in disable mode.

Refer to the below screenshot:

Validate Other Power Apps Fields Based on Radio Button Selected Value

To achieve it, follow the below steps.

1. On the Power Apps Screen -> Select an Edit form, choose Reason_DataCard1, and set its Visible property to the code below.

Visible = If(
    Radio_Status.Selected.Value = "Not Started",
    true,
    false
)

Where,

  • Radio_Status.Selected = Power Apps Radio Button Name
  • “Not Started” = Radio Button Value
Validate Power Apps Fields Based on Radio Button Selected Value

2. Save, Publish, and Preview the app. If a user selects the respective value [“Not Started”] then only the “Reason_DataCard” will appear, or else it will disappear as in the screenshot below.

Power Apps Radio Button Validation

This is how to validate other Power Apps fields based on the Radio button selected value.

Conclusion

This Power Apps tutorial taught us how to make the Power Apps radio button field mandatory. Then, we discussed how to notify the warning message based on the Power Apps Radio button validation.

Also, we saw how to validate the Power Apps Save icon based on the Radio button selection and validate the Power Apps other fields based on the Radio button selected value.

You may like the following tutorials: