cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Deep link to item

I've been trying to get this to work and been stuck.

 

I have a form that is for holiday request, when the user submits the request i would like an email sent to their manager that takes the manager to completed form so they can click 'Approve' or 'Decline' on the press of these buttons an email will be sent to HR department if approved and to the requester only if declined.

 

I've watched a deep link youtube but this is using gallery selected to select the item, so not what i am looking for.

 

Here is the form, currently on select of the submit button it is just submitting the form. 

 

Absence Request.PNG

i'm guessing that On Success i would add the something like the below  to send an email to the manager.

 

 

Office365Outlook.SendEmailV2("amy.harkus@tbrown.com", "Annual Leave Request", "Please review annual leave request. <a href='https://web.powerapps.com/apps/5e3098f8-3fae-415e-a4ae-40dc2755d266'> HERE <a/>")

 

 

 

 

 

Office365Outlook.SendEmailV2("amy.harkus@tbrown.com", "Annual Leave Request", "Please review annual leave request. <a href='https://web.powerapps.com/apps/5e3098f8-3fae-415e-a4ae-40dc2755d266?AnnualLeaveID=2'> HERE <a/>")

 

 

 

The part i'm stuck on is setting the parameter, if anyone could provide me a step guide to do this.  

 

Thanks you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Deep link to item

Hi @amyharkus86 ,

So I can understand which bits are not working, you have two distinct processes here.

  1. Generating the email with the link in it
  2. Opening the app from the "deep link" at the correct record for the manager to approve.

From what you are saying, the second bit works, (which was your original question).

Now your problem is sending the email with the ID of the new record you have just created. I have found patchy results from this function, but I will give you something to try. On the OnSuccess of the new form Submission, try this

If(
   vEmailSend,
   Office365Outlook.SendEmailV2(
      "amy.harkus@tbrown.com", 
      "Subject goes here", 
      "<a href='https://apps.powerapps.com/play/5e3098f8-3fae-415e-a4ae-40dc2755d266?
      tenantId=9a20ce32-86cd-4614-920f-dc519b4e128b&LeaveID=" & 
      EmployeeAbsenceForm.LastSubmit.ID & "'> Link </a> "
    );  
   UpdateContext({vEmailSend:false})
)

On the Submit of the form

UpdateContext({vEmailSend:true});
SubmitForm(EmployeeAbsenceForm);
Navigate(ThankYou)

The Variable is so it does not send an email if you edit the form.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

12 REPLIES 12
Highlighted
Super User III
Super User III

Re: Deep link to item

Hi @amyharkus86 ,

The parameter is the easy bit - just add ?xxxx=yy to the end of the URL, where xxxx is the parameter name and yy is the value of this. The more challenging bit is preparing the app for the "incoming" parameter. So at App OnStart, you need to capture to parameter

If(
  !isblank(
   Param("xxxx")
   ),
   Set(
   vParam,Param("xxxx")
)

Then use vParam for whatever you need.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Resolver I
Resolver I

Re: Deep link to item

Thank you,

So I've added this to the OnSuccess

Office365Outlook.SendEmailV2("amy.harkus@tbrown.com", "Annual Leave Request", "Please review annual leave request. <a href='https://web.powerapps.com/apps/5e3098f8-3fae-415e-a4ae-40dc2755d266?AnnualLeave=ID'> HERE <a/>");Navigate(ThankYou)

And OnStart for the App this

Set(VarUserEmail, User().Email) && Set(CurrentUserUPN,Office365Users.MyProfile().UserPrincipalName);ClearCollect(O365GroupMembers,Office365Groups.ListGroupMembers(“SharePoint_Managers”).value);
Set(IsO365GroupMember,If(!IsBlank(LookUp(O365GroupMembers,userPrincipalName=CurrentUserUPN)),true,false)); If(!IsBlank(Param("AnnualLeave")), Set(vParam,Param("AnnualLeave"))

Please ignore the first part, This relates to another screen on the app with repeating tables, The part reflecting this section of the app is

If(!IsBlank(Param("AnnualLeave")), Set(vParam,Param("AnnualLeave"))

 The email (currently being sent to me for test purpose) opens to the front screen of the app and not the item though.

 

I know I am doing something wrong, for some reason this is just not making sense to me, and I know its going to be something silly!

 

I appreciate all the help I can get.

Highlighted
Super User III
Super User III

Re: Deep link to item

Ok @amyharkus86 ,

Firstly the email will send a link to the recipient that will open the app with a variable AnnualLeave set to the ID from which the email was launched. You code is correct in doing this.

I assume you have another form for the manager to accept or decline. If so (I will call it ApprovalForm - change to your name), you add to OnStart

Set(VarUserEmail, User().Email); Set(CurrentUserUPN,Office365Users.MyProfile().UserPrincipalName);
ClearCollect(O365GroupMembers,Office365Groups.ListGroupMembers(“SharePoint_Managers”).value);
Set(IsO365GroupMember,If(!IsBlank(LookUp(O365GroupMembers,userPrincipalName=CurrentUserUPN)),true,false)); 
If(
   !IsBlank(Param("AnnualLeave")), 
   Set(vParam,Param("AnnualLeave");
   Navigate(ApprovalForm)
)

Then on the Item of ApprovalForm  (replace bottom line) 

If(
   !isBlank(vParam),
   Lookup(
      YourListName,
      ID = vParam,
      Whatever It Is Now
)

this will open the Approval for at the record set by the email

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Resolver I
Resolver I

Re: Deep link to item

Yes I have an approval form, for the Item of the approval form you said to add

 

If(
   !IsBlank(vParam),
   LookUp(
      'Employee Absence Request (App)',
      id = vParam,
      Whatever It Is Now
)

What do I need to put in replacement for 'Whatever it is now'

 

Again thank you and sorry I'm clearly bit slow on this for some reason.

 

Highlighted
Resolver I
Resolver I

Re: Deep link to item

On my form submission screen/form I have OnSuccess

Office365Outlook.SendEmailV2("amy.harkus@tbrown.com", "Annual Leave Request", "Please review annual leave request. <a href='https://web.powerapps.com/apps/5e3098f8-3fae-415e-a4ae-40dc2755d266?AnnualLeave=ID'> HERE <a/>");Navigate(ThankYou)

 I then have On Start of the App

Set(VarUserEmail, User().Email); Set(CurrentUserUPN,Office365Users.MyProfile().UserPrincipalName);
ClearCollect(O365GroupMembers,Office365Groups.ListGroupMembers(“SharePoint_Managers”).value);
Set(IsO365GroupMember,If(!IsBlank(LookUp(O365GroupMembers,userPrincipalName=CurrentUserUPN)),true,false)); 
If(
   !IsBlank(Param("AnnualLeave")), 
   Set(vParam,Param("AnnualLeave");
   Navigate(EmploeeApprovalFormApprovalForm)
)

And on the Item of my Approval form, edit form I have

If(
   !IsBlank(vParam),
   LookUp(
      'Employee Absence Request (App)',
      id = vParam,
      Whatever It Is Now
)

 My SharePoint list is called 'Employee Absence Request (App)' and it has field names

Fields.PNG

Highlighted
Super User III
Super User III

Re: Deep link to item

Thanks @amyharkus86 ,

I am in a different time zone to you (early Thursday morning here).

I am trying to give you the syntax and logic of this more than explicit code so you can repeat and extend this as necessary.

Firstly, the Whatever it is now is just that - what was the Item property before you put in the new code. It would have been something like BrowseGallery1.Selected - you need to do this with the gallery name it was selected from.

So to go through what the code is doing

Office365Outlook.SendEmailV2("amy.harkus@tbrown.com", "Annual Leave Request", "Please review annual leave request. <a href='https://web.powerapps.com/apps/5e3098f8-3fae-415e-a4ae-40dc2755d266?AnnualLeave="& YourIDRef & "'> HERE <a/>");Navigate(ThankYou)

Note what I have changed - you need to replace YourIDRef something like GalleryName.Selected.ID (your actual gallery name) and also note the quotes "'> HERE (double - single). This sets a value of the current ID number in a parameter called AnnualLeave in the URL that will open the App from the link in the email.

If(
   !IsBlank(Param("AnnualLeave")), 
   Set(vParam,Param("AnnualLeave");
   Navigate(EmployeeApprovalFormApprovalForm)
)

This looks for the existence of the Parameter AnnualLeave in the URL that the app has been opened by. If it is not there (the app has been opened normally), it opens whatever is the first screen as normal. If the parameter exists however, you have set it to the ID of the record in the email string and it goes to the EmployeeApprovalFormApprovalForm

If(
   !IsBlank(vParam),
   LookUp(
      'Employee Absence Request (App)',
      ID = Value(vParam),
      BrowseGallery1.Selected
)

Once at the form, it needs to know what record to open. If the parameter does not exist, it opens the normal selected record, otherwise (note my small change as the parameter is a string and needs to be changed to a number) it opens the record set by the email parameter.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Resolver I
Resolver I

Re: Deep link to item

I see your in Australia, I have family just outside of Adelaide, Never been but on my bucket list. 

 

Ok so here is what i have

 

App OnStart 

Set(VarUserEmail, User().Email); Set(CurrentUserUPN,Office365Users.MyProfile().UserPrincipalName);
ClearCollect(O365GroupMembers,Office365Groups.ListGroupMembers(“SharePoint_Managers”).value);
Set(IsO365GroupMember,If(!IsBlank(LookUp(O365GroupMembers,userPrincipalName=CurrentUserUPN)),true,false)); 

If(
   !IsBlank(VParam),
   LookUp(
      'Employee Absence Request (App)',
      ID = Value(VParam),
      EmployeeAbsenceGallery.Selected
)

 

I have form called EmployeeAbsenceForm and OnSuccess of this i have 

Office365Outlook.SendEmailV2("amy.harkus@tbrown.com", "Annual Leave Request", "Please review annual leave request. <a href='https://web.powerapps.com/apps/5e3098f8-3fae-415e-a4ae-40dc2755d266?AnnualLeave="& EmployeeAbsenceGallery.Selected.ID & "'> HERE <a/>");Navigate(ThankYou)

 

I have a second form 'ApprovalForm' on the Item i have this 

If(
   !IsBlank(Param("AnnualLeave")), 
   Set(vParam,Param("AnnualLeave");
   Navigate(EmploeeApprovalForm)
)

 I'm getting an error on this part 

aerrorrr.PNG

On the Item properties of my Gallery 'EmployeeAbsenceGallery' (ignore the typo) 

 

Filter('Employee Absence Request (App)', 'Created By'.DisplayName = User().FullName)

 

Do i need to set vParam in there or something to fix the error on the approval form Item error? 

Highlighted
Resolver I
Resolver I

Re: Deep link to item

@WarrenBelz I should probably add that on the gallery  'EmployeeAbsenceGallery' OnSelect it has 

Select(Parent)

 Again thank you for your help.

Highlighted
Super User III
Super User III

Re: Deep link to item

Hi @amyharkus86 ,

Sorry I must have missed your last reply. Have you got this working yet?

To answer your last question, adding that is actually the default, but putting it there will not hurt.

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,852)