Navigate

How to Use the Power Fx Navigate  Function in Power Apps

In this article, we’ll explore how to use the Power Fx Navigate function in Power Apps, step by step.

Step 1: Understanding the Basics of Power Fx Navigate Function

The Navigate function in Power Apps is used to switch between screens. It takes two arguments: the name of the screen you want to navigate to, and any data you want to pass to that screen. The syntax for the Navigate function is as follows:


Navigate(screen [, Transition] [, UpdateContextRecord] [, {parameterName: parameterValue}] [, {animationDuration:milliseconds}] )


The first argument (screen) is required, and the rest are optional. The Transition argument is used to specify the transition animation between screens, while the UpdateContextRecord argument is used to update a record in the app’s context. The last two arguments are used to pass parameters to the screen and set the animation duration, respectively.

Step 2: Creating Screens in Power Apps

Before you can use the Navigate function, you need to create screens in Power Apps. You can create a new screen by clicking the “New Screen” button in the left-hand pane, or by right-clicking an existing screen and selecting “Duplicate Screen”. You can also rename screens by double-clicking on the screen name in the left-hand pane.

Once you have created your screens, you can add controls and data to them as needed. You can also set the screen’s OnVisible property to run any actions or formulas when the screen is first displayed.

Step 3: Using the Power Fx Navigate Function to Switch Between Screens

To use the Navigate function to switch between screens, you’ll need to add a control (such as a button or icon) to your app and set its OnSelect property to the Navigate function. Here’s an example:


OnSelect: Navigate(Screen2, None, {parameterName: “parameterValue”})


In this example, the OnSelect property of the control is set to the Navigate function, with the first argument (screen) set to “Screen2”. The second argument (Transition) is set to “None”, which means no transition animation will be used. The third argument is an object with a single key-value pair, which sets a parameter to be passed to the destination screen.

Step 4: Passing Data Between Screens with the Power Fx Navigate Function

In addition to switching between screens, you can also use the Navigate function to pass data from one screen to another. To do this, you’ll need to set the third argument of the Navigate function to an object containing the data you want to pass.

Here’s an example:


OnSelect: Navigate(Screen2, None, {parameterName: TextInput1.Text})


In this example, the TextInput1 control is used to capture user input, and its value is passed to the destination screen as a parameter.

Step 5: Opening External Web Pages with the Power Fx Navigate Function

Finally, you can also use the Navigate function to open external web pages from within your Power App. To do this, you’ll need to set the first argument (screen) to the URL of the web page you want to open.

Here’s an example:


OnSelect: Navigate(“https://www.google.com”)


In this example, the Navigate function is used to open the Google website in a new browser tab.

The Power Fx Navigate function is a powerful tool for navigating between screens, passing data, and opening external web pages in Power Apps. By following the steps outlined in this article, you can start using the Navigate function in your own apps and take advantage of its full potential.

Power Apps Training Courses by G Com Solutions (0800 998 9248)