cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fraandres
Level: Powered On

Need help with PDF

I'm new on this and I want to build a survey for employees. I have the questions but when I submit button the values don't apper on the htlml-> pdf file. I built a htlm screen. I did a concat on the flow for the button. It does create the file and the pdf but the data is not there.  This is the data needed ( _Name & "</td><td>"& _ENumber &"</td><td>"& _Incident & "</td><td>"& Score &"</td></tr>"). 

 

 


concat('<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
padding: 5px;
}
table {
border-spacing: 15px;
}
</style>
</head>
<body>

<h2>Risk Assesment</h2>
<p>Please attach PDF file to ticket .</p>

<table style=''width:100%'', cellspacing=''5''>
<tr>
<th>Firstname</th>
<th>E# Number</th>
<th>Incident#</th>
<th>Total Score</th>
</tr>
</tr><td>"

&
( _Name & "</td><td>"& _ENumber &"</td><td>"& _Incident & "</td><td>"& Score &"</td></tr>")

&
</table>

</body>
</html>')

4 REPLIES 4
mdevaney
Level 8

Re: Need help with PDF

@fraandres 

I assume you've watched Shane Young's video on this topic already but if you haven't then give it a look.  Its definitely 20 mins well spent https://www.youtube.com/watch?v=2rfAQe1kK8M.

My suggestion would be as follows:

 

  • Initialize a variable for each variable that will be displayed on the invoice
  • Reference the variables as shown below.  That's what worked for me!

 

(variables('_Name') & "</td><td>"& variables('_ENumber') &"</td><td>"&variables('_Incident') & "</td><td>"& Score &"</td></tr>")

Also, I found it easier to build the HTML using the Compose action rather than a Concat() function.  That way I can see all of the code more easily.

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

 

Highlighted
fraandres
Level: Powered On

Re: Need help with PDF

When you mention Initialize a variable for each variable you mean on the Flow? because I did on the HTML and it is giving unsupport its function. 

As well your compose is that on the flow? because there is no compose function. 

this is what I get 

 

Firstname E# Number Incident# Total Score

" & ((_Name) & ""& (_ENumber) &""& (_Incident) & ""& Score &"

thank you 

 (variables(_Name) & "</td><td>"& variables (_ENumber) &"</td><td>"& variables(_Incident) & "</td><td>"& Score &"</td></tr>")

 

Community Support Team
Community Support Team

Re: Need help with PDF

Hi @fraandres ,

Do you want to generate a pdf from html with variable?

As @mdevaney said, firstly, you need to initialize your variables like this:9181.PNG

Secondly, you need to change your formulas like this:

concat('<html>', '<h1>heading 1</h1>', variables('html'), '<h1>heading 2</h1>', variables('html'), '</html>')

On your side, you should try :

(variables('_Name') & "</td><td>"& variables('_ENumber') &"</td><td>"&variables('_Incident') & "</td><td>"& variables('Score') &"</td></tr>")

 Here's a similar doc about this for your reference:

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

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
fraandres
Level: Powered On

Re: Need help with PDF

Thank you that worked, now I have an issue with the conversion from HTML to pdf. The data is on the HTML file but when I convert is blank any idea. @v-yutliu-msft  any ideas? 

 

image.png

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 255 members 4,343 guests
Please welcome our newest community members: