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 not worki...
Power Apps
Unanswered

If statement not working on backicon, OnSelect event

(0) ShareShare
ReportReport
Posted on by 20

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

 

Categories:
I have the same question (0)
  • ricardox180 Profile Picture
    190 on at

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

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

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

  • Jason8 Profile Picture
    20 on at

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

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

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

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