cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
G99
Post Prodigy
Post Prodigy

deep linking issue

Hi

I have a problem with deep linking.

I have 2 screens newscreen for any new forms being submitted and another viewscreen, where users can go to view there records.

On the Viewscreen deep linking works fine and this is how I have set it up:

On my Save button onSelect property I have the following fx:

 

SubmitForm(Form2);Office365Outlook.SendEmailV2(DataCardValue26.Selected.Email, "form has been submitted", "<a href='https://apps.powerapps.com/play/a510b64c-?tenantId=1fbd65bf&MYID=" & VarRecord.ID & "'> Link </a> ")

 

When a user updates a record from the view screen the link received in the email takes them back to the saved item.

 

But when I submit a new record from the Newscreen, the wrong ID is given in the email link taking the user to the wrong item.

This is the fx I have on the submit button of the newform:

Office365Outlook.SendEmailV2(DataCardValue2.Selected.Email & DataCardValue16.Selected.Email, "form has been submitted by" &   DataCardValue10.Selected.DisplayName, "<a href='https://apps.powerapps.com/play/a510b64c?tenantId=1fbd65bf&MYID=" & VarRecord.ID & "'> Link to submitted form </a> ")

 

I cannot see what is wrong here, and where the newform is picking up the incorrect ID from.

I have created a label to see what the ID is when a user is begins to  fill a newform and on the label correctly displays as ID=0 which is correct... so what I'm failing to see is when the new form is submitted why the ID value is not of the item being summitted?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @G99 ,

The reason why you met this problem is that all the value in the form will become invalid after the form is submitted.

If you want to use these value, you need to save them as variables before the form is submitted, then use these variables in your sendemail function.

Or you could also use FormName.LastSubmit.fieldname to represent the value that you submitted just now.

Could you tell me how do you set VarRecord? VarRecord.ID represnts what?

I assume that it is the record's ID.

Here are the solutions in details:

1)use variable:

Set(var1,DataCardValue26.Selected.Email);Set(var2,VarRecord.ID);
SubmitForm(Form2);Office365Outlook.SendEmailV2(var1, "form has been submitted", "<a href='https://apps.powerapps.com/play/a510b64c-?tenantId=1fbd65bf&MYID=" & var2& "'> Link </a> ")

2) use FormName.LastSubmit.fieldname

SubmitForm(Form2);Office365Outlook.SendEmailV2(Form2.LastForm.fieldname1, "form has been submitted", "<a href='https://apps.powerapps.com/play/a510b64c-?tenantId=1fbd65bf&MYID=" & Form2.LastForm.ID & "'> Link </a> ")

 

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yutliu-msft
Community Support
Community Support

Hi @G99 ,

The reason why you met this problem is that all the value in the form will become invalid after the form is submitted.

If you want to use these value, you need to save them as variables before the form is submitted, then use these variables in your sendemail function.

Or you could also use FormName.LastSubmit.fieldname to represent the value that you submitted just now.

Could you tell me how do you set VarRecord? VarRecord.ID represnts what?

I assume that it is the record's ID.

Here are the solutions in details:

1)use variable:

Set(var1,DataCardValue26.Selected.Email);Set(var2,VarRecord.ID);
SubmitForm(Form2);Office365Outlook.SendEmailV2(var1, "form has been submitted", "<a href='https://apps.powerapps.com/play/a510b64c-?tenantId=1fbd65bf&MYID=" & var2& "'> Link </a> ")

2) use FormName.LastSubmit.fieldname

SubmitForm(Form2);Office365Outlook.SendEmailV2(Form2.LastForm.fieldname1, "form has been submitted", "<a href='https://apps.powerapps.com/play/a510b64c-?tenantId=1fbd65bf&MYID=" & Form2.LastForm.ID & "'> Link </a> ")

 

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

HI @v-yutliu-msft 

Thank you for your help.

I have tried to use your variable suggestion and when submitting the 'new' form I get the link in the email but there is no ID number in the URL I have recived, so when I click the link it takes me to the screen where it should display the form data but rather only shows 'Getting your data'

This is the fx I have set on the OnSelect Property for the Submit button:

 

Set(Var1,DataCardValue2.Selected.Email); Set(Var2,VarRecord.ID);
SubmitForm(Form1);
Office365Outlook.SendEmailV2(Var1, "new form submitted", "<a href='https://apps.powerapps.com/play/a510b64c-?tenantId=1fbd65bf&MYID=" & Var2& "'> Link to submitted form </a> Please review the form ",{Cc:DataCardValue10.Selected.Email})

 

Do I need to set Var1 and Var2 at the App OnStart?

Currently on the OnStart of the app this is what I have:

Set(VarID, Value(Param("MYID")));
If(VarID <> 0, Set(VarRecord, LookUp('ListName', ID = VarID));Navigate(ViewScreen))

As mentioned the above works for when a user saves the form from the view screen i.e. Form2, but the issue is it doesnt work on a new form being submitted i.e. Form1.

 

I have also attempted to use the FormName.LastForm.fieldname but it doesn't like the fx:

 

SubmitForm(Form1);
Office365Outlook.SendEmailV2(Form1.LastForm.'NameOfSupervisor', "new form has been submitted", "<a href='https://apps.powerapps.com/play/a510b64c?tenantId=1fbd65bf&MYID=" & Form1.LastForm.ID & "'> Link to submitted form </a> Please review the form ",{Cc:DataCardValue10.Selected.Email})

 

Again I cannot spot anything wrong based on the suggestions you made, are you able to help further please?

HI @v-yutliu-msft

I was able to use #2 and tinker it a bit and its working, so Thank you for your help

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,348)