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

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?

6 REPLIES 6
Community Support Team
Community Support Team

Re: SP Online attachments to PDF in a dynamic table

Hi @Mengeltje,

 

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.

1.PNG

The video for your reference:

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

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

 

Best regards,

Mabel

 

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.
Mengeltje
Level: Powered On

Re: SP Online attachments to PDF in a dynamic table

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:

flow1.PNGflow2.PNG 

 

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

and the concat in the create file is: 

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

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

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


</body>
</html>')

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

Can you advise me?

Thanks.

Jay-Encodian
Level 10

Re: SP Online attachments to PDF in a dynamic table

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: https://support.encodian.com/hc/en-gb/articles/360014632213-Merge-document-array-to-PDF 

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

Mengeltje
Level: Powered On

Re: SP Online attachments to PDF in a dynamic table

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 https://youtu.be/2rfAQe1kK8M and https://youtu.be/bfXV_GXc_JM 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.

 

 

Jay-Encodian
Level 10

Re: SP Online attachments to PDF in a dynamic table

Hi Mengeltje,

 

The encodian connector is a custom connector for which you need an API key, you can register for a free subscription here: https://www.encodian.com/products/document-manager-for-microsoft-flow/ 

 

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

Jay

Highlighted
Super User
Super User

Re: SP Online attachments to PDF in a dynamic table

Hi @Mengeltje . 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

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,904)