powerappspowerapps-formula

How do I navigate to another screen based on the dropdown item in Powerapps?


Below is the canvas-app formula I have tried, please take a look:

Navigate(If(DisplayBuildingDropdown.Selected.Value = "EC - Empire Complex", BuildingStorey))

Below is the image: enter image description here

Hi I have tried the second method but still has the problem: Problem encountered is that my dropdown would not show other dropdown items and it will straight navigate to the next screen :(

The drop down has all these items as show below in the picture: enter image description here

But once I wrote this:

If(DisplayBuildingDropdown.Selected.Value = "EC - Empire Complex", Navigate(ECstorey, Fade)) 

in OnSelect , I cant select other dropdown items to navigate to other screens but I can only get to see EC - Empire complex in the dropdown and it will navigate me to only one screen.


Solution

  • If you want to implement conditional navigation based on the dropdown value you need to start the formula with the if statement:

    If(DisplayBuildingDropdown.Selected.Value = "EC - Empire Complex", Navigate(BuildingStorey, Fade))
    

    I like to translate the code into English: If the dropdown value is EC - Empire Complex, then navigate to BuildingStorey screen.

    The Navigation function requires a second argument that specifies the transition that will occur on screen change (Fade, Cover, Uncover, None). If you don't want an animated transition, simply put "None" as the second argument.

    Here is a useful site to look at for conditional navigation: https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Conditional-Navigation-Triggered-by-User-Selection/ba-p/19488

    And you can look here for more screen transition examples: https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-navigate