cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chrisvdw Advocate I
Advocate I

Include a list of records in the body of any email

Hi,

 

I've got a very simple quoting application, three SharePoint Online custom lists, quotes, quoteitems and products.

All working ok to create and edit quotes with products, sum the quote etc.

 

I like to email the quote, mail address is a field in the quotes list, I can't see anyway to include filter the table and include the quoteitems records in an html table of the body of an email.

 

Thoughts anyone? Need to be able to loop though the records or create a text table.

 

I'd then be able to print the email to get around the no printing from PowerApps issues.

2 REPLIES 2
hpkeong Community Champion
Community Champion

Re: Include a list of records in the body of any email

Hi

 

I learnt this in Project Siena and let me share the link. I had made changes, too and get it done but under Win 10 environment.

(It failed in Android and iOS. I am still trying out and if you are able to get it done, please share)

 

Launch(Concatenate("mailto:emailaddress?subject=YourSubject". "&Body=",BodyText, ...., "%0A%0A", .....BodyText, and can combine with Concat(Table, FieldName, %0A%", ...)

 

I can't paste here the link (My computer maybe problem). Please search in Project Siena forum, by StonyArc and Ayuba (MS).

 

Hope this helps.

hpkeong
EdHacker
Frequent Visitor

Re: Include a list of records in the body of any email

  • galTrackingSteps is a Gallery
  • ReportItem is a collection
  • SMProfile is a collection I use as a local profile.

    The key to building the table body <tbody> is the "Concat(galTrackingSteps.AllItems,.......)"
    function. It acks like a "ForEach..."

 

The following code is included in the "OnSelect" of a Email icon.

  

UpdateContext({addressie:If(IsBlank(First(SMProfile).CurrentEmailAddressie),User().Email,First(SMProfile).CurrentEmailAddressie)}); 

UpdateContext({EmailHtml:{Subject:"Sample Report of " & First(ReportItem).Title ,Body: "<div style=""text-align:center""> <img src=""https://b2slifesc..../b2slifesciences.jpg"" alt=""B2S Logo""></div>" & "<h1>"& "<span style=color:rgb(35,55,141)>" & "Sample: </span>" & "<span style=color:rgb(228,108,11)>" & First(ReportItem).Title & "</span>" & "</h1>" & "<h2>" & "<span style=color:rgb(35,55,141)>Project: </span>" & "<span style=color:rgb(228,108,11)>" &tbProjectName.Text & "</span></h2>" & "<h3 style=color:rgb(35,55,141)>Tracking Steps</h3>"& "<table border=""1"" style=""width=90%"">"& "<thead><tr>" & "<th> "& Last(galTrackingSteps.AllItems).tbLocation.Text&"</th>"& "<th>"& Last(galTrackingSteps.AllItems).tbDate.Text & "</th>" & "<th>" & Last(galTrackingSteps.AllItems).tbVolume.Text & "</th>" & "<th>" & Last(galTrackingSteps.AllItems).tbPreparedBy.Text & "</th>" & "</tr></thead>" & "<tfoot></tfoot>"&" <tbody>" & Concat(galTrackingSteps.AllItems, "<tr><td>" & tbHeading3Location & "</td><td>" & tbSubTitleDateMoved & "</td><td style=""text-align:right"">" & tbTrackingStepVolume & " " & tbTrackingStepVolumeUnit & "</td><td>" & tbSubtitlePreparedBy &"</td></tr> ") &"</tbody>"&"</table>" &"<h3 style=color:rgb(35,55,141)>Aliquot(s)</h3>" &"<table style='width=90%'>"&"<thead><tr><th>Sample</th><th>Volume</th></tr></thead><tbody> "& Concat(galChildren.AllItems, "<tr><td>"& tbChildrenSample &"</td><td style=""text-align:right"">" & tbChildVolume & " "& tbChildrenVolumeUnits & "</td></tr>") & "</tbody></table>" & "<h3 style=color:rgb(35,55,141)>Pooled</h3>" & "<table style='width=90%'><thead><tr><th>Sample</th><th>Volume</th></tr></thead><tbody>"& Concat(galParents.AllItems, "<tr><td> "& tbParentSample &"</td><td style=""text-align:right"">" & tbParentVolume & " " & tbParentVolumeUnits & "</td></tr>")&"</tbody></table>" }}); Office365.SendEmail(addressie, EmailHtml.Subject, EmailHtml.Body, {IsHtml: true})

EmailExample.JPG

 

 

 

 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

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