cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

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

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
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (5,291)