SOLVED

How do i add attachments from Microsoft Forms onto Sharepoint List

Occasional Contributor

Hello. 

Trust everyone is safe and well :smile:.

I have been trying to follow the video on how to add attachments from forms to sharepoint list but i am not doing something right as i keep getting this error. 

 

Any help will be welcome. Thank you

 

Sur76_0-1625394437858.png

 

This is the make up of my flow

 

Sur76_1-1625394496140.png

 

Sur76_2-1625394527721.png

 

On the Parse Json - i am not sure what to add here - i copied and pasted the schema provided

 

Sur76_3-1625394578586.png

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

Sur76_4-1625394609844.png

 

 

5 Replies
best response confirmed by Sur76 (Occasional Contributor)
Solution
Don't use a template to build this flow which will put in that first apply to each which is not needed and usually causes problems. Build it from new going straight from When a new response is submitted to get response details.

Thank you so much. I am going try it now. It worked like a bomb.... You are freaking super awesome .... Thank you soooooo much

@Sur76 So what did you do in the end, exactly? In my Get Response Details it never shows anything about the attachement from the Form? 

@GBeulen no it won't, the steps you need to add a file uploaded to a Microsoft Forms form to an attachment in a SharePoint list are as shown below.

 

Your trigger is the Forms "when a new reponse is submitted". The first action as always is the Forms "get response details":

1-Flow.png

 

You now need to add a "Parse JSON action". In the content field select the question from your form where you asked the user to upload the file.

The schema field will work with the following:

 

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

 

 

2-Flow.png

 

The file is always saved to your OneDrive in the 

/Apps/Microsoft Forms/YourForm/Question folder so in a OneDrive "get file content using path" action add that and follow it with the following expression:

first(body('Parse_JSON'))?['name']
 

3-Flow.png

 

Next, create an item in your SharePoint list:

 

4-Flow.png

 

Next, add an "apply to each" action and in the first field select Body from the Parse JSON section of the dynamic content box.

 

Finally, inside the apply to each add a SharePoint "add attachment" action. In the Id field select ID from the create item section of the dynamic content. In the File name field select name from the Parse JSON section of the dynamic content box. In the File content field select File content from the "get file content using path" section of the dynamic content.

 

 

5-Flow.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@RobElliott 

You are a genius, that has just solved an issue for a beginner, thank you