web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Populate Word Template...
Power Automate
Unanswered

Populate Word Template with Multiple Images submitted from Forms

(0) ShareShare
ReportReport
Posted on by 62

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.

Categories:
I have the same question (0)
  • Verified answer
    MJain Profile Picture
    2,450 on at
    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

  • ChrisCollao Profile Picture
    62 on at
    Re: Populate Word Template with Multiple Images submitted from Forms

    Thanks a lot @ManishJain 

     

    It worked perfectly.

    ChrisCollao_0-1593014362253.png

     

  • Community Power Platform Member Profile Picture
    on at
    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

     

  • ChrisCollao Profile Picture
    62 on at
    Re: Populate Word Template with Multiple Images submitted from Forms

    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

  • Community Power Platform Member Profile Picture
    on at
    Re: Populate Word Template with Multiple Images submitted from Forms

    It perfectly works. Thank you very much, mate.

  • Community Power Platform Member Profile Picture
    on at
    Re: Populate Word Template with Multiple Images submitted from Forms

    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,

  • Timothy2 Profile Picture
    2 on at
    Re: Populate Word Template with Multiple Images submitted from Forms

    Hello! 

     

    I am currently trying to get a forms uploaded image into my word document. Sadly i am getting one of 2 errors. 

    -The file id 'test.png' is not valid.

    Or 

    -The image is not of type PNG or JPG. Please provide an image of type PNG or JPG.

     

    Could anyone help?

  • ChrisCollao Profile Picture
    62 on at
    Re: Populate Word Template with Multiple Images submitted from Forms

    Hi @Timothy2 , do you have a screenshot of the error?

     

    Regards.

  • co-anne Profile Picture
    16 on at
    Re: Populate Word Template with Multiple Images submitted from Forms

    Hi @ChrisCollao, I'm running into the same error as @Timothy2, I believe. Can you please advise? Many thanks in advance!!

    Seems to be "seeing" my jpg and PNG, but output is 400:

    multiple-images_not-of-type.PNG

    Here's the flow w/ error details:

    multiple-images_flow-and-fail.PNG

    Here's the Parse JSON & Get file content for attachment 1:

    multiple-images_parseAtt1.PNG

    I'm using this schema: 

    {
        "type""array",
        "items": {
            "type""object",
            "properties": {
                "name": {
                    "type""string"
                },
                "link": {
                    "type""string"
                },
                "id": {
                    "type""string"
                },
                "type": {},
                "size": {
                    "type""integer"
                },
                "referenceId": {
                    "type""string"
                },
                "driveId": {
                    "type""string"
                },
                "status": {
                    "type""integer"
                },
                "uploadSessionUrl": {}
            },
            "required": [
                "name",
                "link",
                "id",
                "type",
                "size",
                "referenceId",
                "driveId",
                "status",
                "uploadSessionUrl"
            ]
        }
    }

     And here's my first expression: first(body('Parse_JSON_-_Attachment_1'))?['name']

     

    Please let me know if you need any additional details, and thanks again!

  • co-anne Profile Picture
    16 on at
    Re: Populate Word Template with Multiple Images submitted from Forms

    Oh, snap! Update! 

    I was calling the wrong content when populating the template. All better now 😄 Cheers!

    multiple-images_file-content.PNG

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard