cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PhilatBaker
Level 8

Help with an IF Statement on an OnSelect to Navigate to separate screens

I have a variable on a page that is a Yes/No.   

 

If No, I want the button OnSelect to Navigate to a Screen 2 and if YES, I want it to Navigate to Screen 3.  

I get the errors: 

  1. Invalid Argument Type
  2. Invalid Number of Arguments: received 1, expected 2-3
  3. Name is invalid, This identifier isn't recognized. etc....

Here is my Syntax, can you help me correct this?

 

If(DataCardValue45=true, Navigate('Screen 3',ScreenTransition.Fade)[,Navigate('Screen 2'),ScreenTransistion.Fade])

2 ACCEPTED SOLUTIONS

Accepted Solutions
tommyly
Level 8

Re: Help with an IF Statement on an OnSelect to Navigate to separate screens

It looks like you need to adjust your syntax to:

If(DataCardValue45.Value=true,
  Navigate('Statement 3', ScreenTransition.Fade),
  Navigate('Statement 2', ScreenTransition.Fade)
)

Here is a checklist:

  1. change "True" to "true" (lowercase)
  2. Remove the one (and only) occurence of "[" (not needed)
  3. Remove the ")" that follows "Navigate('Statement 2'"
  4. Remove the one (and only) occurence of "]" (not needed)
  5. Add a ")" at the end of the syntax to make up for the misplaced parenthesis that we deleted in step 3

Let me know if that fixed it.

 

View solution in original post

samuelJ
Level 8

Re: Help with an IF Statement on an OnSelect to Navigate to separate screens

In addition to what @tommyly said,

 

Unless this is a style Syntax I am unfamiliar with, I believe the comma for your else section is a character off, see the code below.  

Your code:

If(DataCardValue45=true, Navigate('Screen 3',ScreenTransition.Fade)[,Navigate('Screen 2'),ScreenTransistion.Fade])

 change to:

If(DataCardValue45=true, Navigate('Screen 3',ScreenTransition.Fade), Navigate('Screen 2',ScreenTransistion.Fade))

View solution in original post

5 REPLIES 5
tommyly
Level 8

Re: Help with an IF Statement on an OnSelect to Navigate to separate screens

If DataCardValue45 is a form object, then you probably need to specify its property. For example: DataCardValue45.Text or DataCardValue.Value.

PhilatBaker
Level 8

Re: Help with an IF Statement on an OnSelect to Navigate to separate screens

Yea, it is a form object.  I added Value and it bring up a new error.  I've tried with and without quotes, still not accepting it.

 

IFbuttonerror.PNG

tommyly
Level 8

Re: Help with an IF Statement on an OnSelect to Navigate to separate screens

It looks like you need to adjust your syntax to:

If(DataCardValue45.Value=true,
  Navigate('Statement 3', ScreenTransition.Fade),
  Navigate('Statement 2', ScreenTransition.Fade)
)

Here is a checklist:

  1. change "True" to "true" (lowercase)
  2. Remove the one (and only) occurence of "[" (not needed)
  3. Remove the ")" that follows "Navigate('Statement 2'"
  4. Remove the one (and only) occurence of "]" (not needed)
  5. Add a ")" at the end of the syntax to make up for the misplaced parenthesis that we deleted in step 3

Let me know if that fixed it.

 

View solution in original post

samuelJ
Level 8

Re: Help with an IF Statement on an OnSelect to Navigate to separate screens

In addition to what @tommyly said,

 

Unless this is a style Syntax I am unfamiliar with, I believe the comma for your else section is a character off, see the code below.  

Your code:

If(DataCardValue45=true, Navigate('Screen 3',ScreenTransition.Fade)[,Navigate('Screen 2'),ScreenTransistion.Fade])

 change to:

If(DataCardValue45=true, Navigate('Screen 3',ScreenTransition.Fade), Navigate('Screen 2',ScreenTransistion.Fade))

View solution in original post

PhilatBaker
Level 8

Re: Help with an IF Statement on an OnSelect to Navigate to separate screens

 

That did it.  I owe you guys a beer.   Thanks!

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,565)