web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using subEntityId Para...
Power Apps
Unanswered

Using subEntityId Param for Deep Link Navigation - How to Clear or Reset URL

(1) ShareShare
ReportReport
Posted on by 17

Hey, I have built a basic Case Management Canvas App using Dataverse for Teams. The app is published to a tab in a Teams Channel.

 

When the user opens the app, they start on a landing page with a Gallery listing the cases they have access too. From here, they can either click to open an existing Case or hit a New Case button to create a new Case. The Case form includes a user lookup to select a Team Leader.

 

The app is supported by a Power Automate flow that is triggered by the creation of a new Case. This sends an email to the selected Team Leader, telling them that a new Case has been created. The email includes a button that takes the user into Teams and opens the app at the correct Case. This is done via a Deep Link, using the subEntityId context variable. I have some code on the OnStart event of the app that checks for a value in this variable and navigates the user if it exists. 

 

My OnStart code uses the basic approach of .... If( !IsBlank(Param("subEntityId")), do something .... and uses the subEntityId to find the associated record / set other variables etc.

 

Up to this point, everything is working as expected!

 

Now comes my issue ... the app inside Teams seems to remember the URL and context variable value. So if the user navigates away from the app, browses some other teams, chats with colleagues etc., then navigates back to the app, it reloads the same Case from the email link they originally selected. The subEntityId holds the value even though the user closed and reopened the app.

 

The user has to actually Quit Teams completely before it looses the subEntityId value.

 

I have done some research and it seems that I can't clear subEntityId from within the app. I found some workarounds by using Launch() to reopen and close a fresh instance but this isn't an ideal approach, nor does it work for apps built inside Teams.

 

I have also tried setting a variable with the value of the subEntityId, and using this to navigate to the case as I can clear the value once the user closes the Case.

 

I'm kinda stuck in a loop. The subEntityId is always there and so every time the app loads, it navigates the user. 

 

Does anyone have any thoughts on how best to approach this? Any help would be much appreciated!

 

Luke

Categories:
I have the same question (0)
  • FabianAckeret Profile Picture
    975 on at

    Hi @LukeNZ 

     

    I see your issue... Doesn't seem like a pleasant one to deal with 🙂

     

    What happens if you force Exit() the app after things have been submitted? This might clear the subEntityId.

     

    Kind regards,

  • LukeNZ Profile Picture
    17 on at

    Hi @FabianAckeret - it is a confusing one!

     

    Thanks for your reply, appreciate the help. I will give it a go shorty and let you know the result.

     

    Thanks, 

    Luke

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard