cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KlaasWijbrandi
Frequent Visitor

Get all files(jpg/png) from a folder to use in populate a word document

Hello,

 

Is it possible to get all files (jpg/png) from a folder to use in populate a word document.

In my word template i use the imagecontrol and the control for repeated sections.

 

I have a sharepoint library where i stored images thats been linked by a folder with an objectid.

i want to store all images linked by the objectid in a word file to get a report.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @KlaasWijbrandi ,

 

As far as I know, only one image can be added to an image control of the word document. We generally use Get file content to get the file content and then add the file content to this field.

And when configuring the Populate a Microsoft Word template, we need to configure the value of each field in advance. And you need to traverse to get all the image content, I think this is a very difficult point.

 

Perhaps you can try this configuration to achieve your needs, but the premise is that you already know the number of images saved in the folder, and you have already added the same number of image controls in the word document.

 

  • Initialize the array variable to store all the image file content, use the List folder action to get all the images in the specified folder.
  • Then use Get file content to get the file content and append it to the array variable.
  • Then use the index of the array to get the value of each element, File content, and configure it into the word template.

Image reference:

105.PNG

Details in Apply to each:

106.PNG

 

Best Regards,

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

View solution in original post

1 REPLY 1
v-bacao-msft
Community Support
Community Support

 

Hi @KlaasWijbrandi ,

 

As far as I know, only one image can be added to an image control of the word document. We generally use Get file content to get the file content and then add the file content to this field.

And when configuring the Populate a Microsoft Word template, we need to configure the value of each field in advance. And you need to traverse to get all the image content, I think this is a very difficult point.

 

Perhaps you can try this configuration to achieve your needs, but the premise is that you already know the number of images saved in the folder, and you have already added the same number of image controls in the word document.

 

  • Initialize the array variable to store all the image file content, use the List folder action to get all the images in the specified folder.
  • Then use Get file content to get the file content and append it to the array variable.
  • Then use the index of the array to get the value of each element, File content, and configure it into the word template.

Image reference:

105.PNG

Details in Apply to each:

106.PNG

 

Best Regards,

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (2,502)