web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error 400 Invalid Requ...
Power Automate
Answered

Error 400 Invalid Request, using "Get file content using path" to get an image from OneDrive, saved by an MS Form

(0) ShareShare
ReportReport
Posted on by 13

Hi all. I'd like to request your help resolving this 400 error.

 

I am writing a workflow to send an email, triggered by submitting an MS Form. The form has one mandatory image attachment. Most of the flow is working, however I'm getting a 400 error with the message Invalid request using Get file content using path from OneDrive. The workflow is shown below. The expression in Get file content by path returns the correct URL - I can paste it into a browser and see the image.

Flow.png

Submitting a form results in an error:

Flow Error.png

The raw inputs are:

{

    "host": {

        "connectionReferenceName": "shared_onedriveforbusiness",

        "operationId": "GetFileContentByPath"

    },

    "parameters": {

        "path": "https://westwindenergyaustralia-my.sharepoint.com/personal/powermark_user_w-wind_com_au/Documents/Apps/Microsoft%20Forms/WestWind%20Energy%20OHS%20Compliance%20Document%20Upload/Question/Cockatoo%20and%20magpie%20on%20balcony%20rail_Powermark%20User.jpg",

        "inferContentType": true

    }

}

 

The path is valid - I can paste it into a browser and see the image.

 

The raw outputs are:

{

    "statusCode": 400,

    "headers": {

        "Cache-Control": "no-cache",

        "Pragma": "no-cache",

        "Transfer-Encoding": "chunked",

        "x-ms-request-id": "4c33f474-25b6-46f3-aace-122f89243a05",

        "X-AspNet-Version": "4.0.30319",

        "X-Powered-By": "ASP.NET",

        "Timing-Allow-Origin": "*",

        "x-ms-apihub-cached-response": "false",

        "x-ms-apihub-obo": "false",

        "Date": "Thu, 29 Jun 2023 00:34:44 GMT",

        "Content-Type": "application/json",

        "Expires": "-1"

    },

    "body": {

        "status": 400,

        "message": "Invalid request",

        "source": "api.connectorp.svc.ms"

    }

}

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Simon_Rawson1 ,

     

    Please try this:

    vxiaochenmsft_0-1688017848695.png

     

    Best Regards,

    Wearsky

  • Simon_Rawson1 Profile Picture
    13 on at

    Thanks Wearsky. Two more questions.

     

    In 

    Simon_Rawson1_0-1688081242167.png

    where do I find the GUID to go after body/?

    Not expecting much success, I typed the GUID verbatim and tested it.

    Simon_Rawson1_1-1688081563804.png

     

    It gave me the error below

    Simon_Rawson1_2-1688081606037.png

    Getting past this step, when sending the email, what would I put into the attachment name and attachment content fields?

    Simon_Rawson1_3-1688081952029.png

    Thanks in advance. I appreciate your help.

  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Simon_Rawson1 ,

     

    It is actually the column in the form.

    So your GUID should be different from mine.

    vxiaochenmsft_0-1688089137013.png

    vxiaochenmsft_1-1688089155183.png

    vxiaochenmsft_2-1688089167201.png

     

    vxiaochenmsft_3-1688089450674.png

     

    Best Regards,

    Wearsky

  • Verified answer
    Simon_Rawson1 Profile Picture
    13 on at

    Thanks Wearsky.

    I'll accept your solution. The For Each is good defensive coding, but is not strictly necessary in my case, as there's only 1 mandatory attachment. I ended up re-writing the flow from scratch and it worked first time. I made a typo in the original Get file content using path action JSON expression, and despite correction it seems to have retained a setting. Weird things kept happening in the File Path URL when I was correcting '/'. It kept taking them out.

     

    Here's the working flow:

    Simon_Rawson1_0-1688092735926.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 608

#2
Valantis Profile Picture

Valantis 416

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard