Skip to content
Tutorials Center
My learning

Topics

Lesson 8 of 38 ยท Concepts and Canvas Apps

Screens and Navigation in Power Apps

Add screens, move between them with Navigate and Back, pass context values, use transitions, and design a navigation pattern for a multi-screen canvas app.

Most apps have more than one screen: a list, a detail view, an edit form, maybe a settings page. This lesson shows how to add screens, move between them, and carry information from one screen to the next.

Adding and arranging screens

In Studio, choose New screen on the command bar. You can start from a blank screen or a template (list, form, success, scrollable). Rename every screen with a scr prefix, such as scrHome and scrDetails. The screen listed first in the Tree view is the start screen, unless you set App.StartScreen.

The Navigate function

Navigate shows another screen. Syntax:

TEXT
Navigate(ScreenName, ScreenTransition, ContextRecord)
  • ScreenName: the target, for example scrDetails.
  • ScreenTransition (optional): ScreenTransition.None, Fade, Cover, CoverRight, UnCover, UnCoverRight.
  • ContextRecord (optional): values that become context variables on the new screen.

A button on the home screen might use:

TEXT
Navigate(scrDetails, ScreenTransition.Fade, {selectedTask: galTasks.Selected})

On scrDetails, selectedTask is now a context variable you can read, for example selectedTask.Title. Context variables exist only on that screen. For cross-screen use, a global variable (set with Set) is an alternative; both are covered in Variables and collections.

Going back

Back() returns to the previous screen, using the reverse transition. Use it on a "Back" button. Do not use Navigate to return unless you need a different destination; Back() keeps behavior consistent.

A navigation pattern

Typical flow for a list/detail/edit app:

flowchart LR
  H["scrHome: list"] -->|"select item"| D["scrDetails: view"]
  D -->|"Edit"| E["scrEdit: form"]
  E -->|"Save or Cancel"| D
  D -->|"Back"| H

Pass the chosen record forward so each screen needs no extra lookup.

Tips:

  • Pass the selected record rather than just an ID, to avoid extra data calls.
  • After saving on the edit screen, Back() or Navigate(scrDetails, ...).
  • Hide a screen's controls with Visible, not by creating a hundred screens.

Common patterns:

  • A tab bar at the bottom (phone) built with a horizontal container of buttons or icons. The current tab is highlighted using a variable such as varScreen.
  • A hamburger menu that opens a side panel controlled by a Boolean variable.
  • A header component reused across screens (see the Components and ALM chapter).

The stand-in below implements a simple navigation stack with navigate and back, so you can see the model behind Back().

JS Stand-in: Navigate and Back with a stack

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Screen events

  • OnVisible: runs each time the screen appears. Good for refreshing data (Refresh(Tasks)) or resetting inputs.
  • OnHidden: runs when leaving. Good for clearing temporary state.

Do not place long operations in OnVisible; users see a blank screen while they run.

Highlighting the current tab

A simple approach: store the active name in a variable when navigating, then style tabs against it.

TEXT
// btnTabHome.OnSelect
Set(varTab, "Home"); Navigate(scrHome, ScreenTransition.None)

// btnTabHome.Fill
If(varTab = "Home", RGBA(0, 120, 212, 1), RGBA(230, 230, 230, 1))

The stand-in below evaluates that style rule for each tab.

JS Stand-in: highlight the active tab

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Common mistakes

  • Circular navigation: pressing Back in a loop between two screens. Use Back() only for true "return" actions.
  • Hard-coding records instead of passing the selected one.
  • Too many screens: reuse a single form screen for new and edit modes using a variable.
  • Forgetting that context variables vanish when you leave the screen unless you pass them again.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the third argument of Navigate used for?

    The third argument is a record of context values the target screen can read.
  2. 2. Which function returns to the previous screen?

    Back() navigates to the previously displayed screen.
  3. 3. When does a screen's OnVisible run?

    OnVisible fires whenever the screen is shown.
  4. 4. Which is a good way to reuse one form screen for adding and editing?

    A mode variable with NewForm or EditForm lets a single screen serve both purposes.

Summary

  • Add screens, name them scr..., and set the start screen.
  • Navigate(screen, transition, context) moves forward and can pass context variables.
  • Back() returns; OnVisible and OnHidden are the screen lifecycle events.
  • Pass the selected record rather than IDs when possible.
  • Tabs and menus are controls driven by variables.

Next: Responsive layout with containers