web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Generate PDF from Shar...
Power Automate
Unanswered

Generate PDF from SharePoint list item

(3) ShareShare
ReportReport
Posted on by 104

Hi

 

Is it possible to generate PDF from a SharePoint list item with all the form data when an item is saved into SharePoint?

 

I've looked into the option RenderListDataAsStream. but I guess this only converts word documents into stream

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest

 

Thanks

Categories:
I have the same question (0)
  • Verified answer
    v-yamao-msft Profile Picture
    on at
    Re: Generate PDF from SharePoint list item

    Hi @Rajesh,

     

    Do you want to generate a PDF file from SharePoint list items?

    Please consider using the OneDrive for Business action Convert file to convert an HTML file to PDF.

    Please take the following flow for a reference.

    The flow is triggered by When an item is created in a SharePoint list.

    Get items from the list.

    Create an HTML table from the list.

    Add the action Create file to create an .htm file in OneDrive for Business. Set its File name as ListB.htm.

    Add the action Convert file to convert the file to pdf.

    Last, create a .pdf file with a new name.

    A screenshot for your reference.

    1.PNG

     

    Best regards,

    Mabel

  • NeilLombard Profile Picture
    8 on at
    Re: Generate PDF from SharePoint list item

    How do I get the content of the SharePoint list item into PDF instead of the list of items?

  • Rajesh Profile Picture
    104 on at
    Re: Generate PDF from SharePoint list item

    You create the html first by adding the required content from list item and then save in one drive and convert to pdf as shown in the flow

  • Community Power Platform Member Profile Picture
    on at
    Re: Generate PDF from SharePoint list item

    I Need help with this. My converted PDF contains only the first header and than data in html, 

  • Community Power Platform Member Profile Picture
    on at
    Re: Generate PDF from SharePoint list item

    I've got this working but struggling to put a logo in to the html file? I've tried storing the logo image in the site assets folder on the sharepoint site and referring to the full path in the <img> tag, I've also tried storing the image file in the same folder in OneDrive that the files are generated in but all I get in the html and pdf file is the unknown picture square?

    Help please?

  • Community Power Platform Member Profile Picture
    on at
    Re: Generate PDF from SharePoint list item

    If anyone is interested in this, the answer (thanks to Shane Young) is to put the picture in OD4B, use a get file content action, then store a DataURI(Body('Get_File_Content')) expression into a variable and then put that variable into the html

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

  • DCNehs Profile Picture
    407 on at
    Re: Generate PDF from SharePoint list item

    I tried using this and creating from a Task List.  Running into an issue where i cant choose the "Issue Status Value" so from the dynamic info.  Any ideas?  We only want a DPF to be created if the issue has been closed.

  • JulianaAoyagui Profile Picture
    9 on at
    Re: Generate PDF from SharePoint list item

    Hi Mabel,

     

    Does it work with List items which contains attachements (images, files etc.) too?

     

    Juliana


    @v-yamao-msft wrote:

    Hi @Rajesh,

     

    Do you want to generate a PDF file from SharePoint list items?

    Please consider using the OneDrive for Business action Convert file to convert an HTML file to PDF.

    Please take the following flow for a reference.

    The flow is triggered by When an item is created in a SharePoint list.

    Get items from the list.

    Create an HTML table from the list.

    Add the action Create file to create an .htm file in OneDrive for Business. Set its File name as ListB.htm.

    Add the action Convert file to convert the file to pdf.

    Last, create a .pdf file with a new name.

    A screenshot for your reference.

    1.PNG

     

    Best regards,

    Mabel



    @v-yamao-msft wrote:

    Hi @Rajesh,

     

    Do you want to generate a PDF file from SharePoint list items?

    Please consider using the OneDrive for Business action Convert file to convert an HTML file to PDF.

    Please take the following flow for a reference.

    The flow is triggered by When an item is created in a SharePoint list.

    Get items from the list.

    Create an HTML table from the list.

    Add the action Create file to create an .htm file in OneDrive for Business. Set its File name as ListB.htm.

    Add the action Convert file to convert the file to pdf.

    Last, create a .pdf file with a new name.

    A screenshot for your reference.

    1.PNG

     

    Best regards,

    Mabel


     

  • DCNehs Profile Picture
    407 on at
    Re: Generate PDF from SharePoint list item

    I've tried following the instructions listed and get the following error for "Create HTML table" but not really sure how to fix. Any ideas?

    BadRequest. The 'from' property value in the 'table' action inputs is of type 'Null'. The value must be of type 'Array'.
  • Community Power Platform Member Profile Picture
    on at
    Re: Generate PDF from SharePoint list item

    Hi, what have you put as the input for the create HTML table action? You should use the value from the Get Items action above it

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard