Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Attach a variable number of images to a Form and place them in a Word document

(0) ShareShare
ReportReport
Posted on by 16

Hi all, 

 

I've built a form that allows users to attach up to 10 photos (1 photo per question). The flow slurps all the data into a template and creates a Word document at the end. The flow works great when all 10 images are in, but sometimes the users don't need 10, and the flow errors out when there are < 10. 

 

Here's the error on the JSON hang up: 

flow2.PNG

Here's one of the Parse_JSONs. There's one for each attachment and then I get content using file path, populate the template, and create the file. 

flow1.PNG 

To get around the <10 attachments issue, I've been trying to use a condition to test if there's content for each attachment. If it's not empty, parse JSON and move on, but I can't figure what to do if there is no content. I would like the flow to move on to creating the Word doc with everything it has up to the point where there are no more attachments.

flow3.PNG

 

In theory, is the condition the right approach here? And if so, how do I hop down to the populate the Word template?

 

Many thanks in advance for any guidance!!

 

  • co-anne Profile Picture
    16 on at
    Re: Attach a variable number of images to a Form and place them in a Word document

    Hi @wskinnermctc! Thanks so much! Makes complete sense to limit actions and conditions. I'm trying to apply your suggestions now and am attaching the screenshots of the working version (provided there are 10 attachments 🙂 )

    working-flow1.PNGworking-flow2.PNG

     

  • wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: Attach a variable number of images to a Form and place them in a Word document

    I don't have the exact answer for you at the moment, but I would try to format the flow so that it only has 1 condition which is Has Attachments or No Attachments. You don't want to try and make 10 conditions (If 1 attachment then, if 2 attachment then, etc.)

    The actions that happen to attachments needs to be formatted using an Apply to Each or a Do Until loop. That way you only have one set of actions that happen to the attachments regardless of if their are 1 or 10.

     

    So instead of something like:

    • ParseJSON Attachment 1
    • ParseJSON Attachment 2
    • ParseJSON Attachment 3
    • ParseJSON Attachment 4.....

    You want it to be something like:

    • Apply to Each - (whatever values from form output)
      • ParseJSON Attachment

    That is obviously very bare skeleton outline, but you need to workout how to set it up so there is not a lot of conditions and separate actions dependent on quantity of attachments.

     

    If you show a screenshot of the steps of your initial flow that works with 10 attachments, we can probably give a more clear example solution.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1