cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jasper1234
Helper I
Helper I

Email on submit form, how to include link back to app/this item?

Hi,

i set up a very simple email from within powerapps upon submitting a form / new item to a sharepoint list.  It works well as per below code. How can i include a link in the email which directs the user back to powerapps and this item?

 

SubmitForm('New Form');Office365Outlook.SendEmailV2("email address",
"New QC Schedule Entry",
"Visiting Type:"&'New Form'.LastSubmit.Title&
"<br> Desired Visiting Date:"&'New Form'.LastSubmit.Date&
"<br> Project Name: "&'New Form'.LastSubmit.'project Name'&
"<br> Location:"&'New Form'.LastSubmit.Location
)

 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Microsoft
Microsoft

Hi @Jasper1234 ,

In your email body, you can include an href to your app and pass parameters in through the URL.

Check out the Param() function to see how you pass parameters in, and then pull them out when the app launches.  You can dynamically create an ID parameter in your email, something like this;

 

 

Office365Outlook.SendEmailV2("email address",
"New QC Schedule Entry",
"Visiting Type:"&'New Form'.LastSubmit.Title&
"<br> Desired Visiting Date:"&'New Form'.LastSubmit.Date&
"<br> Project Name: "&'New Form'.LastSubmit.'project Name'&
"<br> Location:"&'New Form'.LastSubmit.Location & 
"<br> <href a=""LinkToYourApp&itemID=" & 'New Form'.LastSubmit.ID & """>Link to App</a>"
)

 

 

LinkToYourApp would be the URL of your App, which you can get from your App Details page, and typically looks something like this;

https://apps.preview.powerapps.com/play/longcomplicatedGUID?tenantId=longcomplicatedGUID 

You append your parameters to the end of that URL using & so if the above item ID was 23 it would look something like this;

https://apps.preview.powerapps.com/play/longcomplicatedguid?tenantId=longcomplicatedGUID&itemID=23 

 

Then in your App OnStart: property, test to see if your app was launched with an "itemID" parameter.  If the itemID parameter has a value, then you know someone used a link in an email to run the app.  You can then "auto-navigate" to whichever screen you want to use to show them the "itemID" you specified in the link.

 

Hope this helps,

RT

 

 

View solution in original post

1 REPLY 1
RusselThomas
Microsoft
Microsoft

Hi @Jasper1234 ,

In your email body, you can include an href to your app and pass parameters in through the URL.

Check out the Param() function to see how you pass parameters in, and then pull them out when the app launches.  You can dynamically create an ID parameter in your email, something like this;

 

 

Office365Outlook.SendEmailV2("email address",
"New QC Schedule Entry",
"Visiting Type:"&'New Form'.LastSubmit.Title&
"<br> Desired Visiting Date:"&'New Form'.LastSubmit.Date&
"<br> Project Name: "&'New Form'.LastSubmit.'project Name'&
"<br> Location:"&'New Form'.LastSubmit.Location & 
"<br> <href a=""LinkToYourApp&itemID=" & 'New Form'.LastSubmit.ID & """>Link to App</a>"
)

 

 

LinkToYourApp would be the URL of your App, which you can get from your App Details page, and typically looks something like this;

https://apps.preview.powerapps.com/play/longcomplicatedGUID?tenantId=longcomplicatedGUID 

You append your parameters to the end of that URL using & so if the above item ID was 23 it would look something like this;

https://apps.preview.powerapps.com/play/longcomplicatedguid?tenantId=longcomplicatedGUID&itemID=23 

 

Then in your App OnStart: property, test to see if your app was launched with an "itemID" parameter.  If the itemID parameter has a value, then you know someone used a link in an email to run the app.  You can then "auto-navigate" to whichever screen you want to use to show them the "itemID" you specified in the link.

 

Hope this helps,

RT

 

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (50,581)