After creating a Microsoft Form with an upload file option, you can setup a flow to send the results of the form in an email with the uploaded file as an attachment using Power Automate.
To get to Power Automate, log on to mail.atu.edu, and click on the square button on the top left hand side of the screen.
Click on All apps.
Click on Power Automate
- Click on My flows
- Click on + New
- Click on Automated--from blank
- Name the flow
- Select "When a new response is submitted Microsoft Forms". A search for Microsoft Forms may be required.
- Click on Create
- Select the Microsoft Form (in this example, it's Upload Form)
- Click on + New step
- Search for Microsoft Forms
- Select "Get response details Microsoft Forms"
- In the Form Id field, select the form again.
- Click in the Response id input box
- Select Response Id from the popup box
- Click on + New step
- Search for Parse JSON
- Select "Parse JSON Data Operation"
- Click in the Content input box
- Select the upload file field from the response details list
- Click in the Schema field and copy and paste the following JSON code:
{ "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" ] } }
4. Click on + New step
- Search for Get file content
- Select "Get file content using path OneDrive for Business"
- Type in the file path to the OneDrive folder in the form /Apps/Microsoft Forms/Form Name/Question/ where Form Name is the name of the Microsoft Form and a slash is at the end of Question. In this example, since the form is named "Upload Form", the path is /Apps/Microsoft Forms/Upload Form/Question/
- Click on Expression in the popup window.
- In the function box, type (or copy and paste) first(body('Parse_JSON'))?['name']
- Click OK
- Click on + New step
- Search for Send Email
- Select "Send an email (V2) Outlook 365 Outlook"
- In the To field type the email address to send the email to and select the email account from the search list.
- Type the subject of the email in the Subject field.
- Format the body with the label and select the appropriate field (4) in the pop up box under Get response details.
- (Response detail fields)
- When finished, click on Show advanced options
- Click in the Attachments Name field.
- In the popup box, click on Expression
- In the function box, type (or copy and paste) first(body('Parse_JSON'))?['name']
- In the popup box, click on OK
- Click in the Attachment Content field
- In the popup box, select File content
- Click on Save
The flow should look like the following:
The "Send an email (V2)" should look like the following: