cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

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
Highlighted
Responsive Resident
Responsive Resident

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

Highlighted
Responsive Resident
Responsive Resident

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
Highlighted
Responsive Resident
Responsive Resident

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.

Highlighted
Resolver I
Resolver I

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

Highlighted
Responsive Resident
Responsive Resident

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

Highlighted
Responsive Resident
Responsive Resident

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

Highlighted
Resolver I
Resolver I

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
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,075)