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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Deep Link to Record
Power Apps
Unanswered

Deep Link to Record

(0) ShareShare
ReportReport
Posted on by

@PowerAddict 

 

Hello,

 

I am attempting to follow a tutorial by the great Shane Young on deep linking to a specific record, but am having trouble. I'm tagging Hardit, but would welcome help from anyone if he is otherwise occupied. 

 

Here is my OnStart formula:

Set(varProjectID, Value(Param("ProjectID")));If(varProjectID<>0, Set(varRecord, LookUp('Tool Design Support Requests',ID=varProjectID));Navigate('Edit Request Screen'))

 

Here is my gallery nav icon formula where the varRecord variable is set:

Set(varRecord,ThisItem);Navigate('Edit Request Screen',Transition.None)

 

And finally, here is the OnSuccess formula of my form which resides on the Edit Request Screen. The formula works in the sense that it sends the email with the proper formatting, but when the link is clicked it takes me to the home screen of the app versus the edit screen for the record. 

 

I have removed the actual GUID and Tenant ID references for the sake of confidentiality, but of course they are present in the app. This screen has 4 tabs/4 forms so I would love to deposit the user on the Designer tab if possible. Can you let me know if that is a possibility?

 

If(Not(varProjectStatus = varNewProjectStatus),
Office365Outlook.SendEmailV2(varUser.Email,"Tool Support Design Request: " & txtRequestTitle.Text & " project status has changed",
"The status of your tool design support request has changed to " & varNewProjectStatus & ". Here is a <a href='https://apps.powerapps.com/play/GUIDSTRING?tenantId=TENANTID&ProjectID=" & varRecord.ID & "'>link to the project</a>. Please take a look at your earliest convenience.",{Importance:"High"}))

 

The correct Project Name comes through in the email and the correct Project ID is in the url of the link (Chicken Coop SharePoint ID is 170) so I feel like I am close. I've attached screenshots of the email and url for your review. If you could help me get over the last hurdle, I would be very grateful. 

 

Kind regards,

Teresa

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    @tagustin2020 

    I've followed the same video with success and your code seems to be correct. Two things I could think of to check would be:

     

    1. Is your listed OnStart code the first, or only, code snippet in your App OnStart? It needs to go first, and

    2. Check that the ID parameter is being set to a Value. It should be because your code uses Value() but you could check this with a label using varProjectID - 1 and make sure the output equals 169 and not -1

     

    To answer you other question, are you saying you have one screen with 4 tabs using 4 forms? If so, my guess is you are using variables to hide/show these forms so you would just need to set the correct variable to land the user on the Designer tab. Definitely doable.

  • tagustin2020 Profile Picture
    on at

    Hello @Anonymous 

     

    Thank you so much for the advice. Changing the order of the OnStart formula components did the trick. In regards to getting the form to open up on the right screen. You are correct in assuming that my tabs and forms operate on variables. The Visible property for the Designer form where I want them to land is set to varFormTab="Designer". My entire OnStart formula can be found below. How do I work the Designer tab/form variable into the formula? Also, I use Concurrent in the OnStart formula, but when I tried to enter the Deep Link portion of the formula after Concurrent, I got red squigglies (even though I changed the semi-colons to commas). Is there a more performant way to structure this OnStart formula?

     

    Set(varProjectID,Value(Param("ProjectID")));If(varProjectID<>0,Set(varRecord,LookUp('Tool Design Support Requests',ID=varProjectID));Navigate('Edit Request Screen'));Concurrent(Set(varUser,User()),Set(varColors,{TealDark:RGBA(0,98,129,1),TealBright:RGBA(28,181,216,1),GrayCharcoal:RGBA(62,67,74,1),GrayMedium:RGBA(215,215,215,1),GrayLight:RGBA(245,245,245,1)}),Set(isAdmin,CountRows('Tool Request Admins')>0),ClearCollect(colRequests,'Tool Design Support Requests'),ClearCollect(colStatus,"Status All"));Collect(colStatus,Choices('Tool Design Support Requests'.'Request Status'))

     

    Thank you,

    Teresa

  • tagustin2020 Profile Picture
    on at

    Hi @Anonymous 

     

    After my last reply to you, I inserted a label after I realized that the right records aren't being returned. Sure enough it came up as a -1. How do I fix that issue?

     

    Kind regards,

    Teresa

  • Community Power Platform Member Profile Picture
    on at

    @tagustin2020 

    insíde the If() part of your Deep Linking code, set the Designer variable before you Navigate ie

     

    If(varProjectID<>0,

           Set(varRecord,LookUp('Tool Design Support Requests',ID=varProjectID));

           Set(varFormTab, "Designer");

           Navigate('Edit Request Screen'))

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    Hi @tagustin2020, just saw this. You are already in the safe hands of @Anonymous, so you should be good 🙂 

     

    Thanks,

    Hardit

  • tagustin2020 Profile Picture
    on at

    Hello,

     

    I updated the OnStart formula to include the reference to the variable, but it is still going to the Request tab. I'm sorry I didn't notice the ID mismatch before. I could have sworn that was working, but it is not working now. Thank you for the testing label tip. Not sure if you saw my other note, but it is coming back as -1. I've attached a screenshot of the ID mismatch. The header label is correct, the form is not. No matter what item I click in the gallery, the forms are pointing to Chicken Coop (ID-170) which happens to be the first item in the SharePoint list (I deleted earlier entries). Again, I apologize for the creep in scope on this question.

     

    Header label formula:

    "Project: " & galHome.Selected.'Request Summary Title'

     

    Gallery nav icon OnSelect formula:

    Set(varRecord,ThisItem);Navigate('Edit Request Screen',Transition.None)

     

    The Item property for each one of my forms:

    varRecord

     

    New OnStart formula with variable:

    Set(varProjectID,Value(Param("ProjectID")));If(varProjectID<>0,Set(varRecord,LookUp('Tool Design Support Requests',ID=varProjectID));Set(varFormTab, “Designer”);Navigate('Edit Request Screen'));Concurrent(Set(varUser,User()),Set(varColors,{TealDark:RGBA(0,98,129,1),TealBright:RGBA(28,181,216,1),GrayCharcoal:RGBA(62,67,74,1),GrayMedium:RGBA(215,215,215,1),GrayLight:RGBA(245,245,245,1)}),Set(isAdmin,CountRows('Tool Request Admins')>0),ClearCollect(colRequests,'Tool Design Support Requests'),ClearCollect(colStatus,"Status All"));Collect(colStatus,Choices('Tool Design Support Requests'.'Request Status'))

     

    Let me know if there is any other info you need in order to troubleshoot this.

     

    Thank you,

    Teresa

  • Community Power Platform Member Profile Picture
    on at

    @tagustin2020 

    Make sure you are testing that label from your email and not inside your App Dev.

    That label check I recommended will only show 169 if you are sending ID=170 via the email, otherwise it will show -1.

     

    Apologies if I created any confusion.

  • tagustin2020 Profile Picture
    on at

    Yes, @Anonymous is great. I'm sure he'll be able to help me reach a resolution. Thanks for checking in. Have a great day! Teresa

  • tagustin2020 Profile Picture
    on at

    No problem Eelman. I'm just happy to have your help! I put the label into the email and it is displaying as -1. I sent an email from the Coax Tip screen and as you can see, it is showing up as Chicken Coop, the first item in the list. I've attached screenshots of the email I received and the app view I am taken to when I click the link in the email.

     

    The results are the opposite of what I get if I navigate the app directly. The emailed version is correct in the URL ID and the Form that is displayed, but the header label is wrong. 

     

    Kind regards,

    Teresa

  • Community Power Platform Member Profile Picture
    on at

    @tagustin2020 

    The label idea was just a way of checking the ID was getting set as a value when coming 'in from your email' ... not going out from your app. From your earlier replies, it appears that it is getting set correctly so there's no real need for the label anymore.

     

    However, if you want to understand what I was trying to do, maybe this will help:

    - add a label, set the Text to varProjectID - 1

    - Save & publish the App

    - use the app as intended, and send original email

    - click email link

    - check the label output, this should be the record ID from the third step minus 1

     

    Remember, varProjectID will only get set to a value other than zero if the URL has an ID parameter attached. If it doesn't then varProjectID = 0.

     

    Hope this makes sense? If you are still unsure, simply remove the label and all should be well with your world/app 🙂 

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard