Hi, i have a button able to send the collection data to email
ffice365Outlook.SendEmail("email","Test222",Concatenate("<table style=""width:100%"" border=""1"">
<tr>
<th>BBB</th>
<th>Finding</th>
<th>Rectification</th>
</tr>",Concat(ForAll(FilteredCollection,"
<tr>
<td>"&ThisRecord.No&"</td>
"&"<td>"&Concat(Filter(ForAll(ThisRecord.image,If("before" in ThisRecord.DisplayName,"<img height=""100"" width =""100"" src='"&ThisRecord.AbsoluteUri&"'>")),!IsBlank(Value)),Value)&"</td>"&"<td>"&Concat(Filter(ForAll(ThisRecord.image,If("after" in ThisRecord.DisplayName,"<img height=""100"" width =""100"" src='"&ThisRecord.AbsoluteUri&"'>")),!IsBlank(Value)),Value)&"</td>"&"
</tr>
"),Value),"</table>"),{IsHtml: true })
Email Received
Now the question is, is it possible to convert it to a word file? Meaning that when i click on the button, i will be able to see the table in the email as well as the word attachment which also consist of the table ?
Thank you
Here is an example. I created an app that has a small collection called 'myData' containing the path to an image in onedrive, the relative path to the image, and the name of the file.
When you press the button it invokes a flow and passes the collection to the flow as a JSON array using the following
HTML2PDF.Run(JSON(myData,JSONFormat.Compact))
The flow then processes the collection. Here are screenshots of the flow.
The array is passed in as the only parameter and processed using a Parse JSON action
I then create two string Variables, one to hold the top of the HTML file and one to hold the bottom.
Next I create a loop to process the JSON array loaded earlier. Inside the loop I use the relative path to retrieve the image contents, A compose to translate the contents to DataURI encoding, and then append the converted image and name to the header string variable as an HTML row. The loop processes each image.
once the loop exits I append the html footer variable to close out the HTML. Then I save the HTML file to OneDrive, Convert it to PDF, and then save the Converted file. (Encodian has a conversion option that can convert from HTML to Word).
Here's what the finished file looks like.
By Collection I assume you mean an array. If so you would use an Apply to Each loop to loop through the array, retrieve each image and save it to HTML using the dataUri() function. Inside each loop you would add all the entries to the HTML table for that Row.
HI @Pstork1 , yes, there are no issues when get the specific image in sharepoint/one drive and convert into 64images.
Currently my problem is,
the images are in a collection. How do i get the content of the images from a collection in powerapps and , process them with the dataUri() function?
As Shane explained in the video you need to convert the images to files and then insert the contents of the files into the HTML. You can't just reference the images by URL. You have to get the file content, process it with the dataUri() function and insert the resulting string into the HTML. Shane does this with a variable at around the 10 minute mark of the video. If you are doing multiple images you can do it with either a variable or a Compose.
Shane Young has a great video on creating PDFs from HTML. But the convert action he uses can also output to Word format. So yes the HTML table can be converted to a Word document and then attached to the email using Power Automate.
PowerApps PDF Generator using Microsoft Flow PDF Converter - Bing video
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
58
Michael E. Gernaey
42
Super User 2025 Season 1