cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

Hi @Anonymous 

 

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
Gareth1
Resolver IV
Resolver IV

Hi @Anonymous 

 

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

Anonymous
Not applicable

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

Anonymous
Not applicable

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 ?

 

 

Hi @Anonymous 

 

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

Anonymous
Not applicable

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"
}

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

It should have the first property as Name
GlennGall
Regular Visitor

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

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

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (4,393)