Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Convert PDF not working

(0) ShareShare
ReportReport
Posted on by 762

Hello Community,
I need your help please!
I've built a Flow that converts HTML to a PDF the Flow runs with no errors, but when I look at the PDF Document in the SharePoint Library, I only see the header and not any of the Table information.
This is my Flow

Convert PDF File.jpg

This is the HTML I have used and tested in w3schools

concat - html.jpg

This is the PDF in my SharePoint Library, only showing the header.

PDF Doc.jpg

Can anyone help as to why the table is not displaying
Thank you in advance for assistance,

Kind regards

Claire

  • ClaireAllen Profile Picture
    762 on at
    Re: Convert PDF not working

    Hello @Paulie78 
    In the Compose HTML, would I copy all my HTML within the input section?
    I'm a little confused, where you have put TextGoesHere,
    Would you mind clarifying this for me please, 
    Thank you
    Claire

  • Paulie78 Profile Picture
    8,416 Super User 2025 Season 1 on at
    Re: Convert PDF not working

    @ClaireAllen something like this:

    2021-04-08_11-05-44.png

  • Paulie78 Profile Picture
    8,416 Super User 2025 Season 1 on at
    Re: Convert PDF not working

    I'd just have a single compose with your HTML source in it. and then have place holders within it to represent values. Like ClairesValue1 etc. Then I would have a series of composes which just do a replace of the compose which contains the HTML, changing the place holders to the values you want.

     

    The HTML concat method you are doing is entirely valid, just could end up being difficult to comprehend/maintain.

  • ClaireAllen Profile Picture
    762 on at
    Re: Convert PDF not working

    Hello @Paulie78 ,

    Thanks for the info

    out of , what approach would you take?
    Regards

    Claire

  • Paulie78 Profile Picture
    8,416 Super User 2025 Season 1 on at
    Re: Convert PDF not working

    You were/are missing a closing single quote. Personally I would suggest a different approach to this concat method you are using. But this should fix your expression error:

     

    concat(
    '<!DOCTYPE html><html><head><style>table, th, td {border: 1px solid black;border-collapse: collapse;}th, td {padding: 15px;text-align: left;}table#t01 {width: 100%;background-color: #f1f1c1;}</style></head></body><h2> PFPE Trial: ', 
    variables('ObjectList')?['Title'],
    '<h/h2><table style="width:100%"><tr><td>Twin Leg Fall Arrest Lanyard: Make</td><td>',
    variables('ObjectList')?['TLFALMake'],
    '</td></tr><tr><td>Twin Leg Fall Arrest Lanyard: Model</td><td>',
    variables('ObjectList')?['TLFALModel'],
    '</td></tr><tr><td>Twin Leg Fall Arrest Lanyard: Serial Number</td><td>',
    variables('ObjectList')?['TLFALSerialNumber'],
    '</td></tr><tr><td>Personal Fall Limiter: Make</td><td>',
    variables('ObjectList')?['PFLMake'],
    '</td></tr><tr><td>Personal Fall Limiter: Model</td><td>',
    variables('ObjectList')?['PFLModel'],'</td></tr><tr><td>Personal Fall Limiter: Serial Number</td><td>',
    variables('ObjectList')?['PFLSerialNumber'],'</td></tr><tr><td>Work Restraint: Make</td><td>',
    variables('ObjectList')?['WRMake'],'</td></tr><tr><td>Work Restraint: Model</td><td>',
    variables('ObjectList')?['WRModel'],'</td></tr><tr><td>Work Restraint: Serial Number</td><td>',
    variables('ObjectList')?['WRSerialNumber'],
    '</td></tr></table></body></html>'
    )

    https://pastebin.com/0wuz2kQ4

     

  • ClaireAllen Profile Picture
    762 on at
    Re: Convert PDF not working

    Hello @Pstork1 

    Really sorry, I'm still getting an invalid expression message

    I've believe I've corrected the change required, I've tried with a space after ] and without a space but still get the error

    ClaireAllen_1-1617867716614.png

     

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Convert PDF not working

    You fixed the closing table tag, but not the closing <h2> tag

    image.png

  • ClaireAllen Profile Picture
    762 on at
    Re: Convert PDF not working

    Hello @Pstork1 ,

    Thank you for coming back to me.

     

    I'm not sure if I have updated the HTML in the correct places as I now get an invalid expression message when I try to copy this into the Expression,

     

    This is what I changed it to, sorry new to HTML so appreciate any guidance.

     

    concat('<!DOCTYPE html>

    <html>

    <head>

    <style>

    table, th, td {

    border: 1px solid black;

        border-collapse: collapse;

    }

    th, td {

    padding: 15px;

        text-align: left;

    }

    table#t01 {

    width: 100%;

        background-color: #f1f1c1;

    }

    </style>

    </head>

    </body>

     

    <h2> PFPE Trial: ', variables('ObjectList')?['Title'],<h/h2>'

    <table style="width:100%">

    <tr><td>Twin Leg Fall Arrest Lanyard: Make</td><td>',variables('ObjectList')?['TLFALMake'],'</td></tr>

    <tr><td>Twin Leg Fall Arrest Lanyard: Model</td><td>',variables('ObjectList')?['TLFALModel'],'</td></tr>

    <tr><td>Twin Leg Fall Arrest Lanyard: Serial Number</td><td>',variables('ObjectList')?['TLFALSerialNumber'],'</td></tr>

    <tr><td>Personal Fall Limiter: Make</td><td>',variables('ObjectList')?['PFLMake'],'</td></tr>

    <tr><td>Personal Fall Limiter: Model</td><td>',variables('ObjectList')?['PFLModel'],'</td></tr>

    <tr><td>Personal Fall Limiter: Serial Number</td><td>',variables('ObjectList')?['PFLSerialNumber'],'</td></tr>

    <tr><td>Work Restraint: Make</td><td>',variables('ObjectList')?['WRMake'],'</td></tr>

    <tr><td>Work Restraint: Model</td><td>',variables('ObjectList')?['WRModel'],'</td></tr>

    <tr><td>Work Restraint: Serial Number</td><td>',variables('ObjectList')?['WRSerialNumber'],'</td></tr>

    </table></body></html>')

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Convert PDF not working

    I see two problems with the HTML at this point.

    1) The closing tag on the title ism '<h/h2>' and it should just be </h2>'.  If the title never closes the table may not show.

    2) The Table doesn't have a </table> closing tag after the final row and before the closing </body> tag.

     

    Change those two mistakes and try again.  If there are still issues we can take a deeper look.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1