Skip to content
Home » Navigate function in Power Apps

Navigate function in Power Apps

The Navigate function in Power Apps is used to change the screen within an app.
It allows for a dynamic user experience by enabling users to move from one screen to another based on their actions, such as clicking a button

Syntax:

Navigate( ScreenName [, Transition [, UpdateContextRecord ] ] )

  • ScreenName: Required, the screen to which the user is being navigated.
  • Transition: Optional, the type of visual effect used during the navigation (e.g., None, Fade, Cover, UnCover). The default value is None.
  • UpdateContextRecord : Optional, a record used to update the context variables during the navigation.

Using Navigation to change the screen within App

As shown, our Canvas App contains two screens: Screen1 (named screen_1) and Screen2 (named screen_2). We have added a button to Screen1 and labeled it “Navigation”.




 

Lets navigates from the current screen which is Screen1 to Screen2.

Go to the OnSelect property of button and write below formula.

Navigate(screen_2, ScreenTransition.None)

In this formula, the value ScreenTransition.None indicates that no transition effect will be applied during navigation.

This is the default value, so if you omit the second argument, the transition will automatically be set to None by default.

 

Let’s run the app and click the “Navigate” button. You can see it navigates you to Screen2

Similarly, you can also explore other transition effects when navigating between screens.

Navigate( screen_2, ScreenTransition.Fade ):  To navigate to a screen named screen_2 with a “fade” transition effect.

Navigate( screen_2, ScreenTransition.Cover): To navigate to a screen named screen_2 with a “Cover” transition effect.

Using Navigate with Context

You can navigates to Screen2, and passes the context variable value during the navigation.

Go to OnSelect property of Navigate button and write below formula.

This formula passes the context variable var_Label value “This is Screen 2” to target screen which is screen_2. This variable can be used on the new screen for dynamic content display.

Navigate(
    screen_2,
    ScreenTransition.Cover,
    {var_Label: "This is Screen 2"}
)

In this formula, {var_Label: “This is Screen 2”}  is a context variable being passed to screen_2.

var_Label is the name of the context variable.

“This is Screen 2” is the value assigned to the variable. This can be displayed or used on screen_2.

Next add Text Label control,  and set it’s Text property to var_Label.




Now, run the App, On Screen 1 click on Navigate button.
You can see that the value passed to the context variable on Screen1 during navigation is now displayed in the Text label on Screen2.
Recommended for you

Loading

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SQL BI Tutorials

Subscribe now to keep reading and get access to the full archive.

Continue reading