Saving Attachments with Microsoft Forms and Power Automate (Flow)

When working on a task for work using Microsoft Forms I came across the ability to upload attachments. I then needed to find a way to use those attachments by saving the results to a SharePoint list.

In this video I will go through how to use the File Upload option in Microsoft Forms and then with Microsoft Flow save the response and attachments to a Sharepoint list.

There is currently a limitation to how this works. When you use the File Upload option you cannot share the form externally

Flow used to create a new item in Sharepoint list

Below is an example of creating an item in a Sharepoint list, which we can then use to add the attachments uploaded to the form.

Example of attachment handling

In order to upload the attachments submitted with a form you first need to use a Parse JSON action to convert the results from the file upload question.

Once you have parsed the JSON (there is a sample of the JSON schema below). You can then retrieve the file contents using the OneDrive Get File Content action. Then add the attachment to the Sharepoint item created earlier

JSON Code used to interpret the form response

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "name": {
                "type": "string"
            },
            "link": {
                "type": "string"
            },
            "id": {
                "type": "string"
            },
            "type": {},
            "size": {
                "type": "integer"
            },
            "referenceId": {
                "type": "string"
            },
            "driveId": {
                "type": "string"
            },
            "status": {
                "type": "integer"
            },
            "uploadSessionUrl": {}
        },
        "required": [
            "name",
            "link",
            "id",
            "type",
            "size",
            "referenceId",
            "driveId",
            "status",
            "uploadSessionUrl"
        ]
    }
}

About: Gareth


8 thoughts on “Saving Attachments with Microsoft Forms and Power Automate (Flow)”

  1. Great article and detailed instructions.

    The one drive process doesn’t work for “Group Forms” where the attachments are saved into the SharePoint site /Documents /Apps… folder.

    Do you have steps for attaching those files to the list / email in the flow?

  2. Hi Gareth, how does this work if the file is stored initial on Sharepoint not OneDrive? How do you get the file ID from a Sharepoint Library?

  3. I would also like to know about how to get the file from SharePoint and not OneDrive. I try using ‘Get file content’ for SharePoint instead of OneDrive but I get a 404 saying the file doesn’t exsist when I use the id from the JSON.

  4. I’m not sure why but this site is loading very slow for
    me. Is anyone else having this problem or is it a problem on my end?
    I’ll check back later on and see if the problem still
    exists.

  5. The solution is awesome! it did the trick!! Thanks a lot
    That’s a pity that once you have created a question with uploaded files, the form cannot be shared externally 🙁

Leave a Reply

Your email address will not be published.