Save Microsoft form responses to SharePoint list using Power Automate
In this exercise, we will learn how to save the Microsoft Form responses in the sharepoint list by using the power automate with attachment.
Step 1: Go to the Power Automate. This is the Official Power Automate website link.
Step 2: Click on the Templates on the left-hand side navigation menu in the Power Automate. Select the Record form responses in SharePoint.

Step 3: After selecting we can add our name of the form, and the sharepoint list and map the columns of sharepoint and form question response.

Step 4: After this whenever the new form response is submitted, a new record is created in the SharePoint list.

Step 5: Let’s we have one attachment question also where we upload the attachment. The files attached can be zero, one or multiple.

The attachment content from the microsoft form in the power automate returns as the string value, which contains the file name, content, and other details. To get the attachment first use the json function to convert the string to the valid json. The json() function accepts the string as the argument.
Power Automate expression
Here, <attachment-dynamic-content> is just the placeholder replace it with the dynamic content of the attachment question.

Step 6: After getting the json content, we will get the file content which is specified by the id property of the json returned value from the above step.
To get the file content use the Get file content action of OneDrive for Business.

Specify the below power automate expression for the File property of the action.
Power Automate expression
Note when the item() is used in the loop it refers to the current item in the array.

Step 7: After getting the file content now its time to add an attachment in the sharepoint list item. Add the Add attachment sharepoint action in the power automate.
Let’s specify the Site Address, List Name, Id. Here ID comes from the Create item action of the sharepoint. For the File Name, specify the below power automate expression.
Power Automate expression
Note, here the name property contains the file name with extension.

For the File Content specify the Body dynamic content of the Get file content action of OneDrive.

Step 9: Let’s save the flow and submit a new form with attachments.
For testing I have submitted the form with two images, Test 1.png and Test 2.png.

We can see that the record is created in the sharepoint, and the images are also attached to the sharepoint list item.

Step 10: One more this if the attachment is optional, then we can check whether any attachment is uploaded in the form. To do that add a condition control, and specify the same power automate expression which is given as the input in apply to each i.e. json(<attachment-dynamic-content>) and check it with null value means no attachment is uploaded.
