In my previous blog post I outlined how Power Automate can be used to get responses from Microsoft Forms into Microsoft List. As a follow up to that post, I will show how to add attachments from Forms to Microsoft Lists using Power Automate. See my previous blog post for the form, List and Flow build.
From Power Automate, click “New step”, search for “Data Operation” and select the “Compose” action. This action will generate the required JSON schema needed to parse the attachment JSON.
Set “Inputs” to “Associated files” from the Forms “Get response details” action.
Test the Flow and when complete expand the “Compose” step and copy the outputs.
Click “New step”, search for “Data Operation” and select the “Parse JSON” action. This action will extract the attachment metadata.
Set “Content” to “Associated files” from the Forms “Get response details” action; paste the “Compose” outputs into “Schema” and click “Generate from sample”.
Click “New step”, search for “Data Operation” and select the “Compose” action. Power Automate will automatically add a “Apply to each” loop.
Set “Inputs” to “name” from the “Parse JSON” action.
Click “New step”, search for “OneDrive for Business” and select the “Get file content using path” action. This action will extract the attachment content. Note: Forms will store attachments in your OneDrive > Apps > Microsoft Forms > form name i.e. “Issue tracker” > Questions.
Set “File Path” to your Forms attachment location, i.e. “/Apps/Microsoft Forms/Issue tracker/Question/” and add the following expression:
Click “New step”, search for “SharePoint” and select the “Add attachment” action.
Set the “Site Address” and “List Name” to you target site and list.
Set “Id” to “ID” from the previous “Create item” action.
Set “File Name” to “name” from the “Parse JSON” action.
Set “File Content” to “File content” from “Get file content using path” action.
My completed Flow looks like the image below.
Save your Flow and test by submitting a new item from the “Issue tracker” form. If all goes well your Forms submission will be stored in Microsoft Lists and the attachments will be added to the List entry.
Forms is another excellent tool for citizen developers in the Microsoft 365 toolbox. Getting Forms response data and attachments into Microsoft Lists provides so many opportunities for business process automation using Power Automate without relying on “traditional” IT.
Thanks for reading.