I’ve seen some questions recently on the Power Platform Forums about how to send multiple attachments submitted in Microsoft Forms in an email. Since this seems to be a common problem I thought it would be good to walk through the steps in a BLOG post.
-
Once you have a Microsoft Form created that includes a question with an attachment you can create a new Power Automate Flow that uses the “When a new response is submitted” trigger. That will start your flow each time a response is submitted through Microsoft Forms. But the trigger alone won’t provide enough detail about what is in the response. So you also need to add a “Get response details” action to retrieve the questions and the answers submitted in the form.
-
Now you are ready to retrieve the details of the files attached to the question in the response and add them to the array. To do that you need to use “Parse JSON” to parse the contents of the question in the response where the files were uploaded. Run your flow once at this point to get some sample output that you can use to generate the JSON schema. Then add your question content to the Parse JSON.
-
Files uploaded to a Microsoft Form are automatically stored in the Form creator’s OneDrive for Business account. So now that we have access to the details of those files from the Parse JSON action we can retrieve the file content from OneDrive and append it to the Array we created in Step #2. We’ll use the file id to retrieve the file and then add the Name of the file and the File content to the array. Whether there is one file or multiple files the details will be in an array, so we’ll need to use an “Apply to each” loop to get each file and append it. The File content can ge used directly as we retrieve it from OneDrive. No translation to Base64 is required because the file is retrieved as JSON, not binary.
Now you can save and test your flow by filling out the Microsoft Form and uploading one or more attachments to the form. In under 5 minutes you should get an email with the attachments from the form.