cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

If statement not working on backicon, OnSelect event

I am creating my first PowerApps app.

 

I am wanting to use the back arrow to return to different screens depending on the value of the variable.

 

I am using the OnSelect event of the BackArrow Icon

 

//Navigate(Intro, ScreenTransition.None)



//If(varCreateShift = true,Set(varlbltext, "Create") , Set(varlbltext, "review") )



If(varCreateShift = true,Navigate(Intro, ScreenTransition.None),Navigate(BrowseScreen1, ScreenTransition.None)

 

First off I used the navigate function to return to the previous screen All works perfectly fine.

 

Then I used the if statement and checked the value of the variable and displayed different text in a label for the variables true/false, again this worked fine.

 

So thirdly I replaced the label display to navigate back to the screen, that I would like to return to. At this point nothing happens and I am a little puzzled. PowerApps

 

Many thanks for all help

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@Jason8 

Your formula has a syntax error to it.  Please consider changing your Formula to the following:

 

If(varCreateShift,
    Navigate(Intro, ScreenTransition.None),
    Navigate(BrowseScreen1, ScreenTransition.None)
)

You were missing the closing parenthesis.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

4 REPLIES 4
Helper III
Helper III

Hi, maybe you should use: UpdateContext({varCreateShift:false}), for change the variable value. In your code I think that your variable is not changing.

Super User III
Super User III

@Jason8 

Your formula has a syntax error to it.  Please consider changing your Formula to the following:

 

If(varCreateShift,
    Navigate(Intro, ScreenTransition.None),
    Navigate(BrowseScreen1, ScreenTransition.None)
)

You were missing the closing parenthesis.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Thanks I looked it and just couldn't see it!  guess to use to red crosses in visual studio

@Jason8 

Yes, the editor is much different than VS.  Sometimes the errors are quite obscure. 

Glad to help.

 

If this was helpful and was a solution for you, please go back and find which message solved the problem and mark it as a solution so that other having the same issue can find a solution quickly.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (3,536)