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

Populate Word Template with Multiple Images submitted from Forms

Hi everyone,

 

I want to ask if anyone has an idea of how to resolve this. I've using several posts to finally achieve the posibility to use a Form to upload files, attach them to a new item on SharePoint, generate a PDF Report with the submitted answer and also attach it to the item on SharePoint.

 

But, I would like to see if there's a chance to populate one Word Template with different images uploaded from Forms.

 

The details:

- I've already created a Word Template with 3 fields to upload an image:

ChrisCollao_2-1592935000109.png

 

 

- I do have a Form with 3 question where users can upload 1 image on each question.

ChrisCollao_0-1592934598701.png

 

- I've made a Flow with 3 JSON Parse to obtain the details of those files:

ChrisCollao_1-1592934703867.png

 

- But, when I want to use "Get file content using path" (Onedrive Business) Flow generates automaticaly an "Apply to each" that will not generate an output with the file content. Meaning that I can't use the image file to populate the word template on a step out of the "Apply to each".

ChrisCollao_3-1592935184186.png

 

How can I populate this 3 image fields?

 

Feel free to ask if anything is not clear or if you need more information/screenshots.

 

Thanks a lot for your help.

 

Best regards.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Specialist
Solution Specialist

Re: Populate Word Template with Multiple Images submitted from Forms

Hi @ChrisCollao ,

 

In Parse JSON you are using array when you are having only one file. so ideally you should not be using Apply to each loop to populate word file. Instead use First(body('Parse_JSON')?['yourfilecontent'].

 

Thanks

View solution in original post

4 REPLIES 4
Highlighted
Solution Specialist
Solution Specialist

Re: Populate Word Template with Multiple Images submitted from Forms

Hi @ChrisCollao ,

 

In Parse JSON you are using array when you are having only one file. so ideally you should not be using Apply to each loop to populate word file. Instead use First(body('Parse_JSON')?['yourfilecontent'].

 

Thanks

View solution in original post

Highlighted
Frequent Visitor

Re: Populate Word Template with Multiple Images submitted from Forms

Thanks a lot @ManishJain 

 

It worked perfectly.

ChrisCollao_0-1593014362253.png

 

Highlighted
Regular Visitor

Re: Populate Word Template with Multiple Images submitted from Forms

Hi guys,

same problem.

What should I insert in 'yourfilecontent'?

Can you post the correct filled expression?

Thank you very much

 

Highlighted
Frequent Visitor

Re: Populate Word Template with Multiple Images submitted from Forms

Hi @IacopoBacci 

 

Sorry, few days ago I answered but I don't know what happened with the post 🙁

 

You must use the tag 'name' on that portion. Here is the complete sentence:

 

first(body('Parse_JSON'))?['name']

 

Also you have to note that the 'Parse_JSON' part must have the full name of the Parse JSON step you created.

 

In my case:

flow21.PNG

 

The full sentence is: first(body('Parse_JSON_-_Img_Anomalia_IF_1'))?['name']

 

Hope this help you.

 

Let me know.

 

Cheers

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (4,687)