sharepointdeep-linkingpowerappsnavigateurl

MS PowerApps Deep Linking


I'm passing a parameter to a PowerApp through the calling URL called ID, i.e. https://web.powerapps.com/apps/powerappid?ID=32

When the app launches I want it to jump from BrowseScreen1 which lists all the Business Cases and go straight to the Business Case with the matching ID (a field from a SharePoint list).

I'm brand new to PowerApps but pretty sure what I need to do is called Deep Linking and I found this tutorial https://powerapps.microsoft.com/en-us/blog/powerapps-deep-linking/ and having read the comments to the article I'm trying to apply it to the OnStart property of BrowseScreen1. I don't really understand how the navigation link in the tutorial is constructed so I'm sure I'm using the wrong Navigation parameters as it always launches the first record in the list ignoring anything to do with the ID. I'm using:

If(Not(IsBlank(Param("ID"))),Navigate(DetailScreen1, None,{ID:LookUp('Full Business Case For Review'.ID, ID = Value(Param("ID")))}))

'Full Business Case For Review' is the name of the Sharepoint list and ID is a unique field that gets assigned to each list item.

The tutorial doesn't mention having to change anything on the detail screen but I've also wondered if I need to perhaps change the item properties there as they are currently:

BrowseGallery1.Selected

I'm feeling out of my depth and would really appreciate some help on this!

Thanks,

John


Solution

  • Yes, you need to change the Item property in the detail screen. This is because there is currently no way to select an item in a gallery programmatically in PowerApps.

    I normally get around this by using a global variable to store the current item, so you can set BrowseSreen1.OnStart to this

    If(Not(IsBlank(Param("ID"))),
        Set(CurrentItem, LookUp('Full Business Case For Review'.ID, ID = Value(Param("ID"))));
            Navigate(DetailScreen1, None)
        )
    

    This will store the item with ID equal to your parameter as a record type variable.

    You also need to change the OnSelect property of your BrowseGallery1's template or whichever control is used to navigate to the detail screen. It will need to be something like this

    Set(CurrentItem, ThisItem); Navigate(DetailScreen1, None)
    

    Finally set the Item property in the detail screen simply to this

    CurrentItem