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

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
Community Support Team
Community Support Team

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

 

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
Community Support Team
Community Support Team

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

 

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

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 (6,422)