cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Processing multiple file uploads from Microsoft Forms

Hi,

 

I have a flow that is triggered by a submission of a form.  The form allows for multiple file uploads under one question.

 

I parse the JSON and then based on the body of the JSON get the file content (from a group sharepoint site) and then append it to an array variable.

 

The problem is I only ever get the first file I have uploaded.  I know it is the way that I am doing the apply to each but can't seem to spot what I am doing wrong.

 

Thanks.

 

multiple file upload.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver IV
Resolver IV

Re: Processing multiple file uploads from Microsoft Forms

Hi @jdrussell78 

 

Glad you got it sorted.

 

To send the attachments via email you will need to make an adjustment to the append to array step.

 

The append to array step needs to look like below. And for the ContentBytes property you will need to wrap the results from the Get File Content action in a base64() expression. This converts the File Content into a string

 

Once you have populated the array you can then pass it to the attachments property in the Advanced Options of the Send Email action.

 

By default the advanced options asks you for a attachment name and attachment content, however there is a little icon to the right of the attachments section that says "switch to input entire array", if you click on this then you can put the attachment array variable in

 

Screen Shot 2020-01-03 at 6.35.54 pm.png

Hopefully this helps

View solution in original post

9 REPLIES 9
Highlighted
Resolver IV
Resolver IV

Re: Processing multiple file uploads from Microsoft Forms

Hi @jdrussell78 

 

Looking at where you are retrieving the file content you are wrapping the parse json in a first expression which will only pull out the first result from the Parse Json action

Screen Shot 2020-01-03 at 5.48.21 pm.png

Highlighted
Helper V
Helper V

Re: Processing multiple file uploads from Microsoft Forms

Thanks Gareth, not too sure I am following though.

 

Here I have the flow "working" but it is not going through each item

 

multiple file upload.JPG

Highlighted
Helper V
Helper V

Re: Processing multiple file uploads from Microsoft Forms

Hey Gareth,

 

Following you now.  Last question.  If I wanted to now have both of these attachments attached to an send email action, how do i do this ?

 

 

Highlighted
Resolver IV
Resolver IV

Re: Processing multiple file uploads from Microsoft Forms

Hi @jdrussell78 

 

Glad you got it sorted.

 

To send the attachments via email you will need to make an adjustment to the append to array step.

 

The append to array step needs to look like below. And for the ContentBytes property you will need to wrap the results from the Get File Content action in a base64() expression. This converts the File Content into a string

 

Once you have populated the array you can then pass it to the attachments property in the Advanced Options of the Send Email action.

 

By default the advanced options asks you for a attachment name and attachment content, however there is a little icon to the right of the attachments section that says "switch to input entire array", if you click on this then you can put the attachment array variable in

 

Screen Shot 2020-01-03 at 6.35.54 pm.png

Hopefully this helps

View solution in original post

Highlighted
Helper V
Helper V

Re: Processing multiple file uploads from Microsoft Forms

Thanks Graham, yes I found that and have set it up as directed:

 

multiple file upload.JPG

 

But when I then test, I get 

 

{
"status": 400,
"message": "Parameter 'Attachment Name' cannot be null or empty.\r\nclientRequestId: 1bececa9-4bb2-4b17-a7fe-8ae09f305d59",
"error": {
"message": "Parameter 'Attachment Name' cannot be null or empty."
},
"source": "office365-ne.azconn-ne-01.p.azurewebsites.net"
}
Highlighted
Resolver IV
Resolver IV

Re: Processing multiple file uploads from Microsoft Forms

It looks like it may be an issue in the append to array action.

It should have the first property as Name
Highlighted
Regular Visitor

Re: Processing multiple file uploads from Microsoft Forms

Anyone has the complete procedure in creating a template? I am struggling quite a bit following the threads here. Thanks.

Highlighted
Resolver IV
Resolver IV

Re: Processing multiple file uploads from Microsoft Forms

Hi @GlennGall 

I wrote an article on how this could be done

 

https://garethhunt.io/index.php/2020/02/18/power-automate-handling-multiple-attachments/

 

Hopefully this helps, if you need anymore help let me know

Highlighted
Regular Visitor

Re: Processing multiple file uploads from Microsoft Forms

Hi Gareth1,

 

Thank you very much for the information! My flow is working now.

 

However, it creates multiple list as well with different attachment each, depending on the number of attachments submitted.

 

I also want to resolve this, as it may affect my reporting later for the number of entries (it will be counted on the number of attachments and not on response in sharepoint).

 

One solution I did is to auto create a folder in the document library linked to the title of the form, and all attachments are saved there.

 

But I am struggling on making a link from the library to the attachment of the item list - there is no template available on this or maybe yes?

 

Probably, you have already done this in the past?

 

Thank you very much for the support.

 

GlennGall

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (10,334)