cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoaoN
Helper IV
Helper IV

HTML code to PDF flow error

Hello Guys.

I created a Flow that get data from a gallery and send it to OneDrive as HTML and PDF version. To do this, I use Shane Young and Chino tips (https://www.youtube.com/watch?v=IhE0-HumNNo&t=1472s).

Now I am trying to insert an image to my HTML/PDF and to do so, Chino and Shane Young suggest to use a variable to get the image from file content and then do the CONCAT function to join the image to the previous HTML code. I did the concat and got the message "Invalid Expression" from flow. This is my code:


 

 

concat('<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
  border: none;
  border-collapse: collapse;
  border-top: none;
}
th {
  text-align: left;
}
</style>
</head>
<body>

<img scr="', variables('var_PDFlogo') ,'">

<h2>Relatório preliminar de sondagem</h2>
<p>Contratante: "& Label16.Text &" </p>
<p>Campanha: "& dpd_Campanha_2.Selected.Result &"</p>
<p> Furo: "& dpd_Furo_2.Selected.Result &"</p>
<br/>



<table style='width:100%'>
  <tr>

  
    <th align = left>Profundidade (m)</th>
    <th align = left>N10</th> 
    <th align = left>ZN10 (cm)</th> 
    <th align = left>Torque máximo (N.m)</th>
  </tr>"
  
  &
Concat(Gallery_OffFuro_2.AllItems,"<tr><td>"& Z & "</td><td>" & N10 & "</td><td>" & ZN10 & "</td><td>" & Tmáx &"</td></tr>")
  &
 
"</Table>

</body>
</html>
')

 

 

 

What am I doing wrong??
I tried to take off the image code ( variables('...')) to check if the other part of HTML was ok, but got the same error.

 

 

<img scr="', variables('var_PDFlogo') ,'">

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Community Champion
Community Champion

Hi @JoaoN 

 

Whilst I cannot pin point your exact problem in the code, have you tried seperating the elements of your html into individual compose actions?

 

Like 

DamoBird365_0-1614453517360.png

 Your call to variables('var_PDFlogo') for instance should be @{variables('var_PDFlogo')} but if you use compose for your varous parts, it will be easy to use concat and select the dynamic content from the expression builder by typing concat in the expression builder first and then switching to dynamic contect to select your fields to join.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

2 REPLIES 2
DamoBird365
Community Champion
Community Champion

Hi @JoaoN 

 

Whilst I cannot pin point your exact problem in the code, have you tried seperating the elements of your html into individual compose actions?

 

Like 

DamoBird365_0-1614453517360.png

 Your call to variables('var_PDFlogo') for instance should be @{variables('var_PDFlogo')} but if you use compose for your varous parts, it will be easy to use concat and select the dynamic content from the expression builder by typing concat in the expression builder first and then switching to dynamic contect to select your fields to join.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

JoaoN
Helper IV
Helper IV

Hi @DamoBird365 ! Thank you so much for your attention!
I was trying to learn more about Compose but I saw what I was doing wrong!! A dumb mistake at image code.

I use "<img scr=....>" when source must be "src". One mistake, all code broken.. but finally I did it ahaha Thank you again!!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (12,268)