cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ljkeefe
Resolver I
Resolver I

PowerApps to PowerAutomate PDF conversion PLUS images

I have searched this community and the PowerApps community and have not been able to find a solution nor a hint on where to start with troubleshooting. First, I'm not very familiar with PowerAutomate so I apologize in advance for my lack of knowledge.

I've created a PowerApp for an intake form, the user will "submit" the form that contains a pen input and an image of terms, it will convert the form into a PDF, and then the user can either email or save to OneDrive.

I have created the HTML of the form's dynamic content in table form and that comes through just fine through the PowerAutomate conversion via the HTML as well as PDF. However, the pen input and the terms (which is an image) do not come through on the PDF, only on HMTL.

I've followed these videos from Shane Young:

https://www.youtube.com/watch?v=pFlwYy8ijiA&t=16s

https://www.youtube.com/watch?v=2rfAQe1kK8M

https://www.youtube.com/watch?v=RFZfvTuDmP0&t=959s

These videos from Chino does Stuff:

https://www.youtube.com/watch?v=IhE0-HumNNo

https://www.youtube.com/watch?v=bciE95PpFX4

This video from Reza Dorrani:

https://www.youtube.com/watch?v=Da4do2DxmJE&t=1341s

Read this article from John Liu:

http://johnliu.net/blog/2017/10/generate-any-pdf-documents-from-html-with-flow

 

I have tried 7 different methods and none produce the images. A few of them didn't produce even my HTML. I don't know where to begin to ask for help. At one point I thought I might have some system restrictions but then I suppose I wouldn't get my text and tables to convert to PDF if I did, correct?

In my PowerApp I've set a variable for each image and used the JSON function. I have a button that when pressed sets the variables and another button when pressed that executes the Flow with the HTML which includes the variable names for the images. 

I hoped that Shane's most recent video released on April 19, 2022, would be the solution but, sadly did not work for me.

This is the last flow I created based on the 4/19/2022 Shane Young video: 

ljkeefe_0-1651615706153.png

Here is the HTML I have in PowerApps: 

 

("<!DOCTYPE html>
<html>
<body>
<style>
table, th, td {
  border:1px solid black;
}
</style>
<p> <b>Assessor</b>: " & AssessorName_1.Text & " 
<b>Date:</b> 
" & DatePicker1_1.SelectedDate & "    
<b>Type:</b> 
" & TypeDD_1.Selected.Value & "  
<b>CARA:</b> 
" & CARADD_1.Selected.Value & " 
<b>Business Name:</b> 
" & BizNameText_1.Text & " 
  <b>Street:</b> 
" & StreetAddyText_1.Text & "
<b> Phone:</b> 
" & BizPhone_1.Text & " 
<b>Site Guide: </b>
" & SiteGuideText_1.Text & "
<b>Email:</b> 
" & EmailText_1.Text & " 
</p> 

<table>
 <tr>
 <td> <strong> Product Storage </strong> </td>
  <td><strong>Spill Management </strong></td>
  <td><strong> Used/Spend Products </strong> </td>
  <td> <strong> Housekeeping </strong> </td>
 </tr>
 <tr>
<td><p>Secondary Containment " & '2ndConDD_1'.Selected.Value & " </p></td>
<td><p>Spill Products/Materials " & SpillProdDD_1.Selected.Value & "</p></td>
<td><p>Secondary Containment " & '2ndContDD_1'.Selected.Value & "</p></td>
<td><p>Parking Lot/Driveway " & PkgLotDD_1.Selected.Value & "</p></td>
</tr>
<tr>
<td><p>Labeling " & LabelingDD_1.Selected.Value & "</p></td>
<td><p> Quantities " & quantitiesDD_1.Selected.Value & "</p></td>
<td><p>Accumulation Time " & AccTimeDD_1.Selected.Value & "</p></td>
<td><p>Dumpsters/Trash Bins/Trash Compactors" & DumpDD_1.Selected.Value & "</p></td>
 </tr>
 <tr>
<td><p>Flammable Storage " & FlammDD_1.Selected.Value & "</p></td>
<td><p>Spill Procedures " & SpillProcDD_1.Selected.Value & "</p></td>
<td><p>Labeling/Compatibility " & LabelCompDD_1.Selected.Value & "</p></td>
<td></td>
</tr>
<tr>
<td><p>Container Sealed/Closed " & SealedDD_1.Selected.Value & "</p></td>
<td><p>Spill Reporting " & SpillRepDD_1.Selected.Value & "</p></td>
<td><p>Recycling " & RecyclDD_1.Selected.Value & " </p></td>
<td></td>
</tr>
<tr>
<td><p>Container Condition   " & ConditionDD_1.Selected.Value & " </p></td>
<td><p>Emergency Contact List " & EmConListDD_1.Selected.Value & " </p></td>
<td><p>Manifest/Receipts " & ManifestDD_1.Selected.Value & " </p></td>
<td></td>
</tr>
<tr>
<td><p>Location " & LocationDD_1.Selected.Value & " </p></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>

<p><label><strong> Business Products and Materials: List Quantities and Location </strong><br></br>
" & TextInput10.Text & " </label> </p><br></br>
<p><label> <strong> Corrective Action Items: </strong> <br></br>
" & CorrectiveActionText.Text & " </p></label>
<br></br>

<image src=" & varPenInput &" > 
<image src=" & varImage1 &" > 

<br></br>

<br></br>


</body>
</html>")

 

Here's the PowerApps variables:

 

Set(varPenInput, JSON(PenInput2.Image, JSONFormat.IncludeBinaryData));
Set(varImage1, JSON(Image1.Image,JSONFormat.IncludeBinaryData))

 

 Any help you can provide would be greatly appreciated.

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
ljkeefe
Resolver I
Resolver I

So I took out all the HTML from the PoweApp code and added back segment by segment, testing after I added a new segment and it worked. I am just scratching my head. I have no idea.

I used the method in this Shane Young video: https://www.youtube.com/watch?v=pFlwYy8ijiA&t=16s 

View solution in original post

1 REPLY 1
ljkeefe
Resolver I
Resolver I

So I took out all the HTML from the PoweApp code and added back segment by segment, testing after I added a new segment and it worked. I am just scratching my head. I have no idea.

I used the method in this Shane Young video: https://www.youtube.com/watch?v=pFlwYy8ijiA&t=16s 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,782)