cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
xxYYxx
Helper I
Helper I

If Expression does not work as expected

Hi all,

I have a radio button with an OnSelect validation, which does not work. 
If I choose for both "Not applicable " it is supposed to end  in "Not defined" but  it ends in "Low Risk". 

If(
    'Radio1.1_1'.Selected.Value = "No" Or 'Radio1.1_1'.Selected.Value = "Not applicable" Or IsBlank('Radio1.1_1'.Selected.Value) And 'Radio1.2_1'.Selected.Value = "Yes" Or 'Radio1.2_1'.Selected.Value = "No",
    Set(
        varResult,
        "Low Risk"
    ),
    Set(
        varResult,
        "Not defined"
    )
);

 

3 REPLIES 3
zmansuri
Super User
Super User

To use And and OR both you need to use brackets.

 

If(
'Radio1.1_1'.Selected.Value = "No" Or 'Radio1.1_1'.Selected.Value = "Not applicable" Or IsBlank('Radio1.1_1'.Selected.Value) And ('Radio1.2_1'.Selected.Value = "Yes" Or 'Radio1.2_1'.Selected.Value = "No"),
Set(
varResult,
"Low Risk"
),
Set(
varResult,
"Not defined"
)
);

xxYYxx
Helper I
Helper I

@zmansuri 
Thank you very much for your fast reply. 
It seems that your provided fix is not complete, because the brackets needs to be in the Or part (after the first Or) as well. 
But thanks anyway!

Glad you worked it out. you can close the thread by clicking accept as solution. 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (5,464)