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
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.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

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 (2,987)