There is a question type in Microsoft Forms that allows the responder to upload a file. This file is automatically uploaded to OneDrive. With Power Automate, you can build a flow that will extract the responses to questions in a form, including a link to file attachments, then send it in an email.
1. Capture response details
In Power Automate, begin with a flow as shown below. The trigger should be Microsoft Forms- When a new response is submitted, followed by the Microsoft Forms action- Get response details. The Form Id should be your form that contains a file upload-type question. Select Response Id dynamic content for the Response Id field.
2. Extract the uploaded file link
The Get response details action allows you to dynamically insert the responses for each question throughout the flow. However, for file-upload questions, the output will look something like this:
The highlighted part above is the URL to the file, which is the only required part in order to provide a hyperlink to access the file in your email. To extract this URL, you will need to use an expression.
Add Compose action. Within the Inputs field, select the expression tab and start typing in the following expression:
With your cursor still in the expression, click on the Dynamic content tab and select the question that contains a file upload.
Your expression will now looks something like this (apart from the red text below, this will be unique):
With your cursor at the end of the expression, type in the following then click OK.
All up, the expression used in this step will look like:
3. Send email with link to file
Add in the last step, Outlook- Send an email (V2). Fill in the details for the action. In the body, you can click on the form questions from the dynamic content list to insert the responses. Do this for the questions you want, except for the file upload question. For this, select the Outputs dynamic content coming from the Compose action.
You will need to switch to code view for the file link to appear as a clickable hyperlink. Click on the </> button to switch to code view.
Type in the highlighted parts as shown below. Make sure there are no spaces or line breaks when you type it in. You will type <a href=”Outputs dynamic content“>Click to view</a>
Save your flow, then test it by submitting a response to your form.
One thought on “Email a link to a file that has been uploaded via Microsoft Forms submission”
Well explained and worked for me , thank you very much