Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

If Expression does not work as expected

Posted on by 79

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"
 )
);

 

Categories:
  • zmansuri Profile Picture
    zmansuri 6,048 on at
    Re: If Expression does not work as expected

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

  • xxYYxx Profile Picture
    xxYYxx 79 on at
    Re: If Expression does not work as expected

    @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!

  • zmansuri Profile Picture
    zmansuri 6,048 on at
    Re: If Expression does not work as expected

    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"
    )
    );

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,733

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,750

Leaderboard