Showing results for 
Search instead for 
Did you mean: 
Not applicable

SP Online attachments to PDF in a dynamic table

Hello everybody,


I have created a PowerApp which, among other things, saves attachments to a SP list (images) and I need these images in a PDF file. I've seen multiple solutions on how to create an email with many images as attachment, I've seen solutions on how to copy all attachments of a list item to another list and I know how to use Flow and OneDrive if I want to use a single image in a PDF file, thanks to a Youtube video of Shane Young.
But I need help to create a PDF file with all attachment of a list item in SharePoint Online. I just cannot get the "apply to each part" working.
Any suggestions of examples would be really welcome?

Community Support
Community Support

Hi @Anonymous,


It seems that you would like to convert all the attachments (images) into one PDF file at a time.

Please consider using the action Append to string action.

I have made the following flow according to this video by Shane Young.

Please take the image for a reference. An html file will be created by using this flow, then you could add the action Convert file using path to convert it to PDF file.


The video for your reference:

Please understand that this link is provided “AS IS” with no warranties or guarantees of content changes, and confers no rights.


Best regards,



Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Not applicable

Hi @v-yamao-msft

Thanks a lot for your answer. It dit help me a lot. But I'm still doing something wrong so I hope you can help me one more time. The flow did create a file but the two images in the SP list I attached are not showing. In another flow without the apply to each and compose function the html file contained the right image.

I have made underneath flow:



The datauri in the append to string is: dataUri(body('Get_file_content'))

and the concat in the create file is: 

concat('<!DOCTYPE html>
table, th, td {
border: 1px solid black;

<h2>Bordered Table</h2>
<p>Use the CSS border property to add a border to the table.</p>

<img src="', variables('logo') ,'">


I can see that the apply to each runs both images the right way.

Can you advise me?


Hi @v-yamao-msftMengeltje 

To clarify; you're trying to extract multiple documents from a list item and convert to PDF? 

FUnnily enough, I've just authored a blog post on this exact topic... it's under review, hopefully is should be available in the next few days... it covers this topic in depth and provides a step by step guide.

In the interim (and to prevent) duplicate content... 

The approach I've defined used the Encodian 'Convert document array to PDF', in essence you obtain all the documents you need to merge into a JSON array and convert to PDF... here's some guidance: 

@v-yamao-msft - could you help with publishing the flow article submitted yesterday as this provides all the steps, or should I replicate here?

Not applicable

Hi @Jay-Encodian@v-yamao-msft,


thank you for your respons. I followed your steps.

Step 7 where I have to add the "Merge document array to PDF" gives me other possibilities than in the screenshot. In my flow an API key is needed instead of the Documents. Maybe I did something wrong?


The method as described by Shane Young and mentioned in this thread and gives me the possibility to use a HTML file with the images. I think the solution of @v-yamao-msft is an easy to use solution only I just need a little help to get it done.



Hi Mengeltje,


The encodian connector is a custom connector for which you need an API key, you can register for a free subscription here: 


That said; lets see if we can get this working as per Shane's solution.


In essence it's just embedding images using Data Uri's in the HTML... so we need to check the input to the final action in your flow. Can you run the flow, then click on the input of the final action and send me the data? I've sent you a private message.


I'll check the data and we can then share the (hopefull) fix on the forum


My best


Resident Rockstar
Resident Rockstar

Hi @Anonymous . Thank you for your post.

I was wondering if you had managed to locate a solution to your issue or if the issues still exists, maybe we could help?

It would be of great help to the community to have a solution posted here and the post marked as complete. Can you share your solution if you have one perhaps?

Thanks, Alan

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!

Helpful resources

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (3,057)