cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChrisCollao
Helper I
Helper I

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
ManishJain
Solution Sage
Solution Sage

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

6 REPLIES 6
ManishJain
Solution Sage
Solution Sage

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

Thanks a lot @ManishJain 

 

It worked perfectly.

ChrisCollao_0-1593014362253.png

 

Anonymous
Not applicable

Hi guys,

same problem.

What should I insert in 'yourfilecontent'?

Can you post the correct filled expression?

Thank you very much

 

Hi @Anonymous 

 

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

Anonymous
Not applicable

It perfectly works. Thank you very much, mate.

Hello @ChrisCollao 

 

Thanks for this answer, I've been looking for a solution like this for many days, 

 

Please could you please, submit the complete flow from start until the end with the generated pdf with multiples images,

 

I have another question, do you know how to replace these fields collecting information from MS Forms, to start collecting all fields and images from power apps?

 

Waiting for prompt response,

 

Harry,

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,809)