web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / If statement with OR f...
Power Apps
Unanswered

If statement with OR function is not working

(0) ShareShare
ReportReport
Posted on 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:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

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

     

  • rajkumar88 Profile Picture
    397 on at

    @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,128 Moderator on at

    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.

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

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

  • rajkumar88 Profile Picture
    397 on at

    @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,921 Super User 2024 Season 1 on at

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

    @CNT It is Healths

  • Verified answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

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

    Awesome thanks @CNT . It worked fine now. 

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @rajkumar88 Glad to help.

     

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard