
Announcements
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!
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