Search code examples
powerappspowerapps-canvas

PowerApps Navigate to screen based on the field value


I have a PowerApps Canvas app, I have a SharePoint list and a power automate workflow. when a user submit a request through PowerApps form, the request is saved in SharePoint list and an email is sent to user for approval, the email contains the link to the powerapps and with param id passed through the link. I need to to navigate to different screen based on the form status field, for example if its pending it should show one screen and if its approved it should show another screen. I tried onStart and onStartScreen the following code but it opens on the home page.

  If(
!IsBlank(Param("ID")),
Navigate(Screen1, ScreenTransition.Fade),
Navigate(Screen2, ScreenTransition.Fade)

)


Solution

  • Take a look at the example. You should be returning a screen, not a Navigate method https://learn.microsoft.com/en-us/power-platform/power-fx/reference/object-app#examples

    For example

    If(
      !IsBlank(Param("ID")),
      Screen1,
      Screen2
    )
    

    Please in future do not use the words Not Working. These words do not describe your issue. I assume your issue is that it opens on the home page instead of the required page