Forum Discussion
How do i add attachments from Microsoft Forms onto Sharepoint List
- Jul 04, 2021Don'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?
- RobElliottNov 08, 2021Silver Contributor
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":
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" ] } }
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']Next, create an item in your SharePoint list:
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.
Rob
Los Gallardos
Microsoft Power Automate Community Super User- keenan_meadowsAug 20, 2024Copper Contributor
How do I find these settings? I understand this answer is a few years old, but I cannot duplicate the instructions here because I am not able to find where to put the trigger in the forms.
Thanks.
- navyjax2Sep 03, 2024Copper Contributor
keenan_meadows It's not about triggers... it's about just searching for the events.
When you do "New Step" in the workflow, you'll keep your category to "All" and look for "Parse JSON", which is in Data Operations.Next step. Search for "Get file content using path", select "One Drive for Business" after getting results to refine what you are looking for. Be careful to get the one that says "...using path", not just "Get file content".
Next step. You shouldn't even need to search for "Apply to each". It should be in the Actions as soon as you create a new step.
Inside the "Apply to each", select "Add an action". Search for "Add attachment". If the SharePoint one doesn't appear, select the SharePoint icon and then look for it. It should be the first one.
- BbhuvaMay 13, 2024Copper Contributor
Could you assist me in resolving the issue with my flow? I have a flow set up where a Microsoft Form submission creates a list in Microsoft List with attachments. While I'm able to see the attachments in the Microsoft List, I encounter an error when attempting to open them.
Thanks in advance.
Bhavesh
- navyjax2Sep 03, 2024Copper ContributorYou might want to check your file path. In the original example he gave, he didn't have "/Shared Documents/Apps/Microsoft Forms", but it just started with "/Apps/Microsoft Forms". Maybe that could be your problem?
- dbohanickJan 04, 2024Copper Contributor
This was great, but what if you want to have the option to include or not include the attachment from the Form to List. I mention this because when I used your workflow and don't attach something in the MS Form, then I get an error.
- Rob_ElliottJan 04, 2024Bronze Contributor
What I do is to go to settings for the actions that relate to the optional file upload, go to settings and select Configure Run After and select Failed as well as is successful. The following images are from our IT Support Ticketing System where uploading a file is not mandatory.
So even if the individual actions actions relating to the file upload fail the flow continues to run and will be shown in the run history as succeeded.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)