Sharepoint list attachments ( image ) into PPTX Template

Hi to All
I need to attach multiple Sharepoint list attachments ( image ) to a PPTX.

I have this power automate flow:


COMPOSE is: base64(body('Get_attachment_content'))

Into the PPTX template i insert an image with this Alt Test

where is the error? because the PPTX is created with the list data, but the images are not inserted.
Also, as there are several images, how do I index them?

thx
Riccardo

Hello @Riccardo_Greggio,

  1. Please use the picture formatter in lowercase (picture, and not Picture)

{{imageData}:picture}

  1. Try to insert only one picture, then if it works combine several pictures into an array.
    Also, check the example and try to repeat the steps.

Best regards,
Petr
Plumsail team

Hi Petr
Thank's for your replay.
I use the picture formatter in lowercase but it doesn't work.
I also tried to insert only one picture as attachment in the list item but no image has been inserted in the PPTX

Riccardo

Hi Ricardo,

I created a test flow and it worked.

These are the steps:

  1. I added an image placeholder with a dummy image to the PPTX template.

  1. I have a test list in SharePoint. There is an item with an image attachment.

  1. I tried to add one picture to simplify the example.

imageData content is the expression:

base64(body('Get_attachment_content'))

The result:

Please try to reproduce the steps. Make sure that the attachment is an image.

Best regards,
Petr
Plumsail team

Hi @Riccardo_Greggio
instead of "Get attachment content", try "Get file content".

Hi @Petr

Can you help me set up the PPTX template if I have several (more than 1) attachments?
Currently, the same data is repeated on another slide with the second attachment because the data has 2 attachments.

Thanks in advance.

Hello @Ferry_Aritonang,

You can combine the attachment content into an Array variable and send the array to the PPTX template.

Please check my reply in the thread where I show an example of inserting an array of images into a DOCX template

Replace the DOCX template with a PPTX template and add the token:

{{images.image}:picture}

Also, use SharePoint Get attachment content instead of the One Drive Get file content action:

Best regards,
Petr
Plumsail team

Hi @Ferry_Aritonang

i have the same result

Hi Petr

I tried to reproduce the steps... but in the pptx i find the dummy image...

image.png

image.png

a question... when i save the pptx template i have the correct "alt text"

image.png

if i open the pptx generated from the process the "alt text" is empty

image.png

what i'm wronging?

Thx

Riccardo

Hi @Petr

Thanks for your reply.

In my case, I have successfully displayed the images.
But, when a row/record of Manpower has 2 attachments/images, the Manpower record will be displayed twice with different image, the first one with attachment 1, the second one with attachment 2.

The Attachments array is in Manpowers array as the following screenshot

The PPTX template looks like below

Thank you.

Hi @Riccardo_Greggio,

The images were not uploaded for some reason. Could you share your template, the data you sent to the template and screenshots of your flow with parameters at support@plumsail.com?

Please also refer to the thread.

Best regards,
Petr
Plumsail team

Hi @Ferry_Aritonang,

Try to place the image placeholder into some repeatable element like a table cell and check if it helps.

Also please check how to arrange loops and nesting in PPTX templates:

I think it repeats all the data on a new slide because there are no repeatable elements on the template slide. The JSON seems don't have nested objects too, although it exists in the template according to the screenshot.

Best regards,
Petr
Plumsail team

Hi @Petr

What do you mean by nested objects?
There is Attachments array inside each Manpower in Manpowers array.

Below is how each attachment appended to Attachments array

I think my problem is I can't figure out yet how to put picture placeholder in a repeatable element, I don't know how to do it yet.

Thank you.

Hi @Ferry_Aritonang,

Yes, I also tried it, and unlike DOCX or Excel templates it seems to be not possible to add a dummy picture with alt text into a table cell in PowerPoint and then repeat the cells.

I'll discuss the case with my team.

Best regards,
Petr
Plumsail team

Hi @Petr

Great, thank you! Please keep me updated on any news.

Regards,
Ferry

Hi @Ferry_Aritonang,

I clarified the question. Unfortunately, due to the specificity of the PowerPoint templates, it's impossible to insert a picture into a repeatable element and add an array of images into one slide.

A possible workaround that might work is inserting images from the array using At operation. But this is a special case when the number of elements (images) in the collection is known in advance, so it is not always applicable.

Also, you can use DOCX templates that support inserting an array of images and save the results into PDF.

Best regards,
Petr
Plumsail team

1 Like

Hi @Petr

Thanks for the update, we will try to switch to using DOCX template then.

Regards,
Ferry

Hi @Petr

It worked fine with pictures when using DOCX template, but I need PPTX as final result.
Unfortunately, DOCX cannot be exported directly using Microsoft Word to PPTX.

Do you have any workarounds on that?

Thank you.

Regards,
Ferry

Hello @Ferry_Aritonang,

One (somewhat roundabout) way to achieve this may be to convert the DOCX document to PDF, then extract all PDF slides as images and insert them into a PPTX document.

PDF-to-images conversion isn't provided by our Documents connector at present, but it can be acheved with free offline tools, such as GhostScript, as described in this StackExchange thread: How to convert PDF to PPT or ODP?. Afterwards, navigate to Insert → Photo Album in PowerPoint to create a PPTX document out of the resulting set of images:

Best regards,
Anton Korotkikh
Plumsail team