Add attachments from Forms to Microsoft Lists using Power Automate

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.

Compose action

Test the Flow and when complete expand the “Compose” step and copy the outputs.

Compose action output

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”.

Parse JSON

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.

Compose to extract names

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: first(body('Parse_JSON'))?['name']

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.

My completed Flow

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.

List entry with attachments.

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.

NY

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s