Question

I am using a Power Apps If statement.

I have four questions that must be answered "YES" in order to proceed to the next screen.

If any of them is answered "NO", then navigates to a different screen.

Using following syntax:

If(Dropdown2.Selected.Value="YES" ,
Dropdown2_1.Selected.Value= "YES",    
Dropdown2_2.Selected.Value= "YES", 
Dropdown2_2.Selected.Value= "YES", 
Navigate(Screen1, ScreenTransition.Fade), Navigate(Screen1_2))

Where am I going wrong?

Was it helpful?

Solution

Try using this:

If(And(Dropdown2.Selected.Value = "YES", Dropdown2_1.Selected.Value = "YES", Dropdown2_2.Selected.Value = "YES", Dropdown2_3.Selected.Value = "YES"), Navigate(YesScreen, ScreenTransition.Fade), Navigate(NoScreen, ScreenTransition.Fade))

OR

If(Or(Dropdown2.Selected.Value = "NO", Dropdown2_1.Selected.Value = "NO", Dropdown2_2.Selected.Value = "NO", Dropdown2_3.Selected.Value = "NO"), Navigate(NoScreen, ScreenTransition.Fade), Navigate(YesScreen, ScreenTransition.Fade))

Change the name of controls, NoScreen & YesScreen with actual name of controls & screens in your app.

Microsoft documentations:

  1. And, Or, and Not functions in Power Apps
  2. If and Switch functions in Power Apps
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top