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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Attach a variable numb...
Power Automate
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!!

 

Categories:
I have the same question (0)
  • wskinnermctc Profile Picture
    6,519 Moderator on at

    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.

  • co-anne Profile Picture
    16 on at

    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

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 957

#2
Valantis Profile Picture

Valantis 847

#3
Haque Profile Picture

Haque 609

Last 30 days Overall leaderboard