cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
theisogunro
Helper IV
Helper IV

Deeplinking parameters causing confusion in App

I have a SharePoint list being rendered through a PowerApp dataTable onto the page(shows a list of sharepoint items).  One of the columns is a link that takes the user to a pop-up showing the details of the single item that was selected, so updates can be made.

theisogunro_1-1627489408858.png

 

When I provide a link to the specific item using DeepLinking (https://play.apps.appsplatform.us/play/xxx83938?tenanteid=03923&requestID=59), I am successfully taken to that specific item.  Here's the issue I am facing, when I navigate away from the item back to the PowerApps page with the list of items and click on a different link, it still shows the item from the deeplinking.  I believe it's because the url doesn't change and my app is still referencing the item with reqeustID=59 which is in the URL.

How can I fix this?

Here's what I have on the App OnStart

 

 

Set(firstRun,true);
If(
    Value(Param("requestID")) <> 0,
    Set(
        itemID,
        LookUp('Registration', ID=Value(Param("requestID"))
     )
   );
   Set(firstRun,false);
   Navigate(EditScreen)
)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
BrianS
Super User
Super User

In your initial email you said there was a point in the app where they navigate away from the details and back to the list. I would do it there. After that you want the app to act normally right - not using the info from the deep-link?

View solution in original post

10 REPLIES 10
BrianS
Super User
Super User

Sounds like you just need to reset the value in your OnSelect that opens your pop-up. If you are always using itemID then you just need to Set that value in the OnSelect to the item that was clicked

GarethPrisk
Resident Rockstar
Resident Rockstar

How is your itemID global variable being used?

You mention that it is being set during app OnStart. If you're using it elsewhere, but not setting it again, it may be causing the issue you described where it is reverting back to the passed in parameter value.

@GarethPrisk 

How do I do this?

 

My OnSelect on my back button is this

 

If(Value(Param("requestID")) <> 0,
   Set(
      itemID,
      {SelectedItem: DataTable6.Selected}
    )
);
Navigate(Admin);

  

When I click back, no matter what item details I go to, it pulls up the same item because of the parameter in the querystring.  How do I deal with that?

@BrianS I used itemID when I'm using Param() but I can't see to use DataTable6.Selected, when I click the back button.

 

If(Value(Param("requestID")) <> 0,
   Set(
      itemID,
      {SelectedItem: DataTable6.Selected}
    )
);
Navigate(Admin);
GarethPrisk
Resident Rockstar
Resident Rockstar

May be able to refactor that, and see if it helps.

If(Value(Param("requestID")) <> 0,
   Set(
      itemID,
      DataTable6.Selected
    )
);
Navigate(Admin);

Whatever is selected in DataTable6 is inherently a record, so you won't need to try to change it. Since your initial setting is a LookUp (returns a record), this may simplify this a bit.

 

Are you trying to see the Param exists? Is there a scenario where it would come in as 0?

@GarethPrisk ,

 

It will come in as zero if the Admin navigates to the PowerApp through the browser and not the link

BrianS
Super User
Super User

I think the problem may be that once they arrive from the link the Parameter will always have data, so the non-zero check will always be true. I think you need to reset your ItemID to the selected item after the initial interaction, or it will continue to be reset to the Parameter version

@BrianS ,

 

That's where I'm stuck. Not sure where to do the resetting.

BrianS
Super User
Super User

In your initial email you said there was a point in the app where they navigate away from the details and back to the list. I would do it there. After that you want the app to act normally right - not using the info from the deep-link?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (4,593)