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.

View solution in original post

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (49,894)