---
title: Save multiple attachments and files from Microsoft Forms to a SharePoint list with Power Automate
description: Learn how to save multiple attachments from Microsoft Forms to a SharePoint list using Power Automate, ensuring all files are stored correctly.
---

[Pragmatic Works Nerd News ](https://pragmaticworks.com/blog)

# [Save multiple attachments and files from Microsoft Forms to a SharePoint list with Power Automate](https://pragmaticworks.com/blog/save-multiple-attachments-and-files-from-microsoft-forms-to-a-sharepoint-list-with-power-automate)

 Written by [Jonathon Silva](https://pragmaticworks.com/blog/author/jonathon-silva) | Sep 13, 2024

In this tutorial, [Jonathan Silva](https://pragmaticworks.com/instructors/jonathon-silva) from Pragmatic Works walks you through the process of saving multiple attachments from Microsoft Forms to a SharePoint list using Power Automate. This approach differs slightly from handling single attachments, and Jonathan provides a detailed explanation of how to adjust your workflow to accommodate multiple file uploads.

 

#### Overview: Single vs. Multiple Attachments

If you’re already familiar with storing a single form attachment into a SharePoint list, you’ll notice that handling multiple attachments requires a few additional steps. In the original workflow for a single attachment, the process is straightforward: you capture the form response, retrieve the attachment, and store it in a SharePoint list. But when allowing users to upload multiple attachments, you need to adjust your flow to loop through and store each file individually.

#### Step 1: Initializing the Attachment Array

To begin, create a copy of your existing flow. This new flow will be used to handle multiple attachments:

- Start by initializing a variable after the **Get Response Details** action. This variable will be an array that stores the attachments.
- Go to **Add an Action** and select **Initialize Variable**.
- Name the variable (e.g., **VAR Attachments Array**) and set the data type to **Array**. Leave the value field blank for now.

#### Step 2: Checking for Multiple Attachments

Next, you need to check if there are multiple attachments in the form response:

- Add a **Condition Control** to evaluate whether the array of attachments is not equal to null.
- In the condition, use the **JSON** expression to convert the attachment question's responses into JSON format. This ensures that Power Automate can process the attachments correctly.
- If the array is not null, proceed to loop through each attachment.

#### Step 3: Looping Through and Appending Attachments

Now that you've confirmed the presence of attachments, it's time to loop through and append each one:

- Add an **Apply to Each** control, which will loop over the JSON array you created in the previous step.
- Within this loop, add an **Append to Array Variable** action. This appends each attachment to the array variable you initialized earlier.
- Use the **item()** function to reference the current attachment within the loop.

#### Step 4: Storing Attachments in SharePoint

With the array of attachments now properly formatted, you can update your flow to store them in SharePoint:

- In the **Create Item** action, update the attachment field to reference the array variable instead of the original attachment question.
- This change ensures that each attachment is added to the corresponding item in your SharePoint list.

#### Testing the Workflow

After saving your flow, test it by submitting a form with multiple attachments:

- Submit a form response with several files attached.
- Check the SharePoint list to confirm that all attachments have been stored correctly.

#### Alternative Approaches

While this method is effective for many use cases, there are other ways to handle file attachments in Power Automate. For example, you could use a Canvas App to manage attachments more dynamically or explore other Power Automate features for more complex scenarios.

Don't forget to check out the [Pragmatic Works' on-demand learning platform](https://learning.pragmaticworkstraining.com/freeTrial/MarketingSiteODLTrial) for more insightful content and training sessions on [Microsoft Forms, SharePoint, Power Automate](https://pragmaticworks.com/courses) and other Microsoft applications. Be sure to subscribe to the [Pragmatic Works YouTube channel](https://www.youtube.com/pragmaticworks?sub_confirmation=1) to stay up-to-date on the latest tips and tricks.

[View full post](https://pragmaticworks.com/blog/save-multiple-attachments-and-files-from-microsoft-forms-to-a-sharepoint-list-with-power-automate)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Jonathon Silva"
  },
  "dateModified" : "2024-09-13T17:15:00.989Z",
  "datePublished" : "2024-09-13T17:15:00Z",
  "headline" : "Save multiple attachments and files from Microsoft Forms to a SharePoint list with Power Automate",
  "image" : {
    "@type" : "ImageObject",
    "height" : 720,
    "url" : "https://blog.pragmaticworks.com/hubfs/Blogimage-Aug-30-2024-07-34-11-7685-PM.jpeg",
    "width" : 1280
  },
  "mainEntityOfPage" : "https://pragmaticworks.com/blog/save-multiple-attachments-and-files-from-microsoft-forms-to-a-sharepoint-list-with-power-automate",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60.0,
      "url" : "https://blog.pragmaticworks.com/hubfs/PW%20Logo-2.png",
      "width" : 217.56097
    },
    "name" : "Pragmatic Works Blog"
  }
}
```