Skip to main content

Notifications

Community site session details

Community site session details

Session Id : ldx2fY30kxdjoelclDPbMm
Power Apps - Building Power Apps
Answered

If statement with OR function is not working

Like (0) ShareShare
ReportReport
Posted on 29 May 2021 17:15:47 by 397

I am trying to achieve below scenario and it's not working in any combination. Hope I get help from someone. 

 

I have three "Yes/No" column types. If any of the field is selected by user as "Yes" then it should navigate to screen1 if all set to NO then navigate to Screen2. 

I am trying this on "Submit" button on "ONSelect" property.

But I am getting error saying

If(Or(DataCardValue3.Selected.Value= "Yes",DataCardValue4.Selected.Value="Yes", radiogroup.selected.value="Yes"),Navigate(Screen1,ScreenTransition.Fade),Navigate(Screen2,ScreenTransition.Fade));SubmitForm(EditForm1);

 

Not sure if I can use Yes/No field as .value= Text? 

Categories:
  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on 31 May 2021 at 17:09:16
    Re: If statement with OR function is not working

    @rajkumar88 Glad to help.

     

    Please remember to give a thumbs-up and accept the solution as it will help others. 

  • rajkumar88 Profile Picture
    397 on 31 May 2021 at 16:06:53
    Re: If statement with OR function is not working

    Awesome thanks @CNT . It worked fine now. 

  • Verified answer
    CNT Profile Picture
    10,919 Super User 2025 Season 1 on 30 May 2021 at 20:22:45
    Re: If statement with OR function is not working

    @rajkumar88 Try this (I've use the control, table and column names as you had given, but please check if they are correct),

    If(Or(Radiogroup1.Selected.Value= 'CovidPositive (Healths)'.Yes,
    	Radiogroup2.Selected.Value='OutofCountry (Healths)'.Yes,
    	Radiogroup3.selected.value='Symptoms (Healths)'.Yes),
    		Navigate(Screen1,ScreenTransition.Fade),
    		Navigate(Screen2,ScreenTransition.Fade)
    );
    SubmitForm(EditForm1);
  • rajkumar88 Profile Picture
    397 on 30 May 2021 at 18:16:35
    Re: If statement with OR function is not working

    @CNT It is Healths

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on 30 May 2021 at 05:58:38
    Re: If statement with OR function is not working

    @rajkumar88 What is the Plural name for the table Health? Is it Healths? Please check and let me know.

    CNT_0-1622354304264.png

     

  • rajkumar88 Profile Picture
    397 on 30 May 2021 at 02:48:38
    Re: If statement with OR function is not working

    @CNT Thanks you for help. Yeah if try like that I am always getting error.

     

    Columname1: CovidPositive
    TableName: Health

    I am using Radiobutton under this column instead of using default Yes/No drop down. 

    RadiobuttonName: Radiogroup1

     

    Column2: OutofCountry

    Radiobutton Name: Radiogroup2

     

    Column3: Symptoms

    Radiobutton: Radiogroup3

     

    If any of these columns are selected as "Yes" then it should navigate to screen2, if all set to NO then navigate to Screen3

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on 29 May 2021 at 23:51:59
    Re: If statement with OR function is not working

    @rajkumar88 For Dataverse, you can't make checks like DataCardValue3.Selected.Value= "Yes"

    You need to use something like, DataCardValue3.Selected.Value='YesNoColumnName (TableName)'.Yes

     

    I can help with the full formula, If you provide the table name and the 3 yes/no column names.

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on 29 May 2021 at 17:50:26
    Re: If statement with OR function is not working

    I'm personably more familiar with patching the data back into SharePoint lists, have not used cds / dataverse all that much. Just sharing proper way to write if and or statements in powerapps, because that will be the same since it is powerapps side.

  • rajkumar88 Profile Picture
    397 on 29 May 2021 at 17:36:13
    Re: If statement with OR function is not working

    @TheRobRush  Thanks for sharing this. I before that I need to fix the radio buttons. Right now i am using column from Dataverse and removing datacard value and then replacing with Radiogroups. Which is not working in my case. 

    do you suggest to create all these Radiogroups directly in PowerApps and save it back to each text filed in Dataverse?  If yes may I know how can saved them back to Dataverse table? 

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on 29 May 2021 at 17:26:55
    Re: If statement with OR function is not working

    Here is a very quick explanation of the proper syntax for IF/AND/OR when using the radio button control.

    You can recreate it in your app to see and learn how it works.

    In this scenario there are 3 radio buttons 

    Radio2

    Radio2_1

    Radio2_2

    All 3 radio buttons items are 

    ["Yes","No"]

     

    and a label that shows No Selection if nothing has been pressed, yes selected if yes has been selected at least one time, and no selected if no is the selection for all 3. 

     

    here is the label code 

     

    If(
     And(
     IsBlank(Radio2)=true,
     IsBlank(Radio2_1)=true,
     IsBlank(Radio2_2)=true),
     "No Selection Made",
     If(
     Or(
     Radio2.Selected.Value="Yes",
     Radio2_1.Selected.Value="Yes",
     Radio2_2.Selected.Value="Yes"),
     "Yes Selected",
     "No Selected"
     ))

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 78 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 41 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 38

Overall leaderboard