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

Deep Linking to Specific ID on Edit Screen

I am trying to create a deep link that my PowerApps creates when creating a new item. Creating a new item triggers PowerApps to send an email and within the email I am wanting to open/link back to that specific record. I am successful loading the app but not getting to the correct ID. I realized what I am/was doing won't work because I was trying to pull an ID number that has not yet been created. Any ideas on how I might be able to accomplish what I want?

OnStart of my App I have:

If(
    Param("DeepLink") = Gallery_Dashboard.Selected.ID /*THIS WON'T WORK, WHAT TO DO HERE? I WANT TO PULL THE ID NUMBER CREATED BY THE NEW ITEM IN MY SPL*/,
    Navigate(Edit),Navigate(Dashboard)
)


On my button to submit the record and generate the email I have:

 

 

//SEND MAIL START
//COLLECTS ALL THE EMAIL ADDRESSES I NEED TO PASS FOR ATTACHING USERS TO THE LEAD ClearCollect(ccEmails,{Mail: LookUp(Agents, FirstLastName = ndd_LeadMember1.Selected.FirstLastName, EmailAddressCC)}); Collect(ccEmails,{Mail: LookUp(Agents, FirstLastName = ndd_LeadMember2.Selected.FirstLastName, EmailAddressCC)}); Collect(ccEmails,{Mail: LookUp(Agents, FirstLastName = ndd_LeadMember3.Selected.FirstLastName, EmailAddressCC)}); Collect(ccEmails,{Mail: LookUp(Agents, FirstLastName = ndd_LeadMember4.Selected.FirstLastName, EmailAddressCC)}); Office365.SendEmailV2(LookUp(Agents, FirstLastName = ndd_AssignedTo.Selected.FirstLastName, EmailAddressT),
//Subject Line ndd_AssignedTo.SelectedText.Value & ", you have a new lead!",
//Message Line "<strong>Name: </strong>" & ntxt_FirstName & " " & ntxt_LastName & "<br><strong>Address: </strong>" & ntxt_Unit & ", " & ntxt_Street & ", " & ntxt_City & ", " & ntxt_Province & "<br><strong>Lead Received From: </strong>" & ndd_Source.Selected.Value & "<br><a href='https://apps.powerapps.com/play/100f3eb7-fc43-4283-a057-aa38a130ca6e?tenantId=d484a071-daef-44c2-a8c4-6bcb3df97dee&DeepLink=" & /*WHAT TO PUT HERE TO PULL THE ID#*/3 & "'> DEEP LINK </a>" & "<br><br><i>Other Lead Members CC'ed: " & ndd_LeadMember1.Selected.FirstLastName & ", " & ndd_LeadMember2.Selected.FirstLastName & ", " & ndd_LeadMember3.Selected.FirstLastName & ", " & ndd_LeadMember4.Selected.FirstLastName & "</i>", {Cc: Concat(ccEmails,Mail,";")} ); //SUBMIT FORM AFTER THE OTHER PROCESSES SO THAT THE FORM DATA DOES NOT BECOME INVALID SubmitForm(NewForm);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Deep Linking to Specific ID on Edit Screen

Hi @KimberlyM ,

You may need to change the order slightly - as you've noted, you can't get the ID until it's been submitted.

By the way - NewForm is a function, so calling your form NewForm might be a little confusing - you might want to alter it slightly to differentiate.

You can Submit the form first, and process the email instead using the OnSuccess: property of the form which fires only after the form has been successfully submitted.  This has the added benefit of giving you access to the NewForm.LastSubmit record of the form which contains the SPL record that was created - including any SPO created fields like the ID, and all other fields that were submitted with the form. So - in your OnSuccess: property email expression;

/*WHAT TO PUT HERE TO PULL THE ID#*/
NewForm.LastSubmit.ID

Hope this helps,

RT

 

View solution in original post

2 REPLIES 2
Highlighted
Microsoft
Microsoft

Re: Deep Linking to Specific ID on Edit Screen

Hi @KimberlyM ,

You may need to change the order slightly - as you've noted, you can't get the ID until it's been submitted.

By the way - NewForm is a function, so calling your form NewForm might be a little confusing - you might want to alter it slightly to differentiate.

You can Submit the form first, and process the email instead using the OnSuccess: property of the form which fires only after the form has been successfully submitted.  This has the added benefit of giving you access to the NewForm.LastSubmit record of the form which contains the SPL record that was created - including any SPO created fields like the ID, and all other fields that were submitted with the form. So - in your OnSuccess: property email expression;

/*WHAT TO PUT HERE TO PULL THE ID#*/
NewForm.LastSubmit.ID

Hope this helps,

RT

 

View solution in original post

Highlighted
Helper IV
Helper IV

Re: Deep Linking to Specific ID on Edit Screen

@RusselThomas thank you! That makes sense to me! I have also now been successful in getting my code to send an email onSuccess of the form. Took me a bit but so glad I figured it out!

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,712)