Skip to main content

Notifications

Power Platform Community / Forums / Building Flows / Form with multiple upl...
Building Flows
Answered

Form with multiple upload file questions each attaching to a separate list item

Posted on by 50

I have a flow that is getting response details from a form.  There are five education questions in the form, each with the option to upload one file.  The flow also creates one list item for EACH education responses (using array/apply to each).  If there are three education responses, the respondent has three list items created.  I'd like to have the file uploads for each of the education questions attached to the associated list item.  I can get the first one to work, but not multiple.

 

Response submitted

Get response details

Initialize variable - array - all education responses

Apply to each - use array

Condition - Current item is not equal to "blank"

Create item (list item in sharepoint for each education response)

Here is where I add the attachment:

Parse JSON - education upload file #1

Get file content using path (Onedrive) - point it to the onedrive folder

Add attachment

 

I tried adding parse JSON for each but it errored.

 

Thanks.

 

  • Suggested answer
    nwagar Profile Picture
    nwagar 50 on at
    Form with multiple upload file questions each attaching to a separate list item
  • nwagar Profile Picture
    nwagar 50 on at
    Re: Form with multiple upload file questions each attaching to a separate list item

    The separate list items for the education responses are working successfully, one line for each response.  I want the uploaded files to go to the attachment column in the associated list item but I can only get the first one to work.  I don't know how to get the other five to work (I'm quite new to automate).  Here is what I'm looking for:

    nwagar_0-1718741710419.png

    nwagar_4-1718741937410.png

     

    nwagar_5-1718741964693.png

     

  • Anil_g Profile Picture
    Anil_g 658 on at
    Re: Form with multiple upload file questions each attaching to a separate list item

    @nwagar 

     

    And what is the if condition there?

     

    the list looks legit..so it should loop for 6 times..but if you say it is not may be that means the codition is failing for 5 items and successful only for one

  • nwagar Profile Picture
    nwagar 50 on at
    Re: Form with multiple upload file questions each attaching to a separate list item

    Anil_g - thanks for assisting.  Here is the screenshot of the education array:

    nwagar_0-1718724103593.png

     

    Now, those values only the education responses, nothing to do with the file uploads.  Maybe need to add the attachments here as well?

  • Anil_g Profile Picture
    Anil_g 658 on at
    Re: Form with multiple upload file questions each attaching to a separate list item

    @nwagar 

     

    Can you show the array you initialized as I belive in the loop you are using the array only and if the array is wrong then the loop will not work..it would loop only once..

     

    i get your requirement..basically for one response depending on number of different educational column values you want to create those many items..for the loop to work as said the array of educations column should be made proper..may be if the data is coming as single string we might need to split to make it an array

     

    cheers

  • nwagar Profile Picture
    nwagar 50 on at
    Re: Form with multiple upload file questions each attaching to a separate list item

    not sure if I'm explaining it well enough.  In the screenshot below is a forms response from one respondent.  This respondent had two education responses and each of those responses had a file upload.  It created two list items (correctly) but the attachment is the same file for both (first response upload).  

    nwagar_0-1718720021548.png

     

  • nwagar Profile Picture
    nwagar 50 on at
    Re: Form with multiple upload file questions each attaching to a separate list item

    I've removed the "loop" because it wasn't working.  I was asking how to make it work, would I have multiple Parse JSON or put them all into one?  I need the uploaded file to be attached to the associated list item that is created.

  • Anil_g Profile Picture
    Anil_g 658 on at
    Re: Form with multiple upload file questions each attaching to a separate list item

    @nwagar 

     

    is the loop working for the number of items?

     

    because if you say you dont have error may be it is looping only once..check that

     

    also small correction...you need not do get file content in loop as it is the same file..you can do it before loop and use the same content for all 3 items

    Also instead of constructing and getting by path you can use get file content with id as well

     

    cheers

  • nwagar Profile Picture
    nwagar 50 on at
    Re: Form with multiple upload file questions each attaching to a separate list item

    nwagar_2-1718717722930.png

    nwagar_3-1718717739330.pngnwagar_4-1718717753891.png

     

     

  • nwagar Profile Picture
    nwagar 50 on at
    Re: Form with multiple upload file questions each attaching to a separate list item

    I'm not getting an error, I just can't get any attachments after the first one.

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update 9/9/24…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,690

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard

Featured topics