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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,414)