Skip to main content

Notifications

Power Automate - Building Flows
Answered

Retrieve the files submitted through a Forms and send them by email using Automate

(1) ShareShare
ReportReport
Posted on by 2

Hello,

I'm having trouble building my Power Automate flow, which is supposed to send form responses by email, including the fields filled out by the user in this form. Currently, I'm unable to attach the image files submitted in this form as attachments in the email sent by Automate.

Some information about the question in my Forms:

The user can upload up to 10 "Image" type files, each with a maximum size of "10MB".

This question is not mandatory, so it's possible that no files are submitted in the form.

Here is the current structure of my flow, which is designed to handle only one attachment. Ultimately, I would like it to handle multiple files.

Image

 

I’m using "Analyser JSON 1" with the form question where the user uploads their files as input, along with the following schema:


{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "name": {
                "type": "string"
            },
            "link": {
                "type": "string"
            },
            "id": {
                "type": "string"
            },
            "size": {
                "type": "integer"
            },
            "referenceId": {
                "type": "string"
            },
            "driveId": {
                "type": "string"
            },
            "status": {
                "type": "integer"
            }
        },
        "required": [
            "name",
            "id"
        ]
    }
}
I then use a condition to check whether the form question where the user uploads their files has been filled out or not.
Image

 

In the case where the link exists, we proceed with the functionality to retrieve the files; otherwise (not yet built), we will continue the process without this functionality.

Next, I use the "Obtenir le contenu du fichier" action, with my SharePoint site address as input and the file identifier set to the link retrieved via JSON (link).

Finally, in the "Envoyer un email (V2)" action, I include my file as an attachment in the following way:

Image

Name = retrieved from JSON (file name)

File content = output from the "Get file content" action

When I run my flow, I encounter an error during the "Get file content" action, which indicates "BadRequest" with the following output:

{
  "status": 400,
  "message": "Route did not match\r\nclientRequestId: c3e9c076-6495-43dc-965e-60870ba223f2\r\nserviceRequestId: 2dff5ea1-9065-a000-1bb3-ad677f498fac"
}

For your information, my files are stored in MY SHAREPOINT > Documents > Applications > Microsoft Forms > NAME OF MY FORM > Document 1.

Could you help me resolve my issue so that Power Automate can locate the file in my SharePoint and send it in the email?

Thank you in advance for your help.

Baptiste Kerdraon

 

  • Verified answer
    FLMike Profile Picture
    FLMike 31,580 on at
    Retrieve the files submitted through a Forms and send them by email using Automate
    HI
     
    You need to loop first and create an array with the attachments, to give them to the Email.
     
     
    Cheers,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard