Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Badrequest error 400 Onedrive for business

(0) ShareShare
ReportReport
Posted on by 5

Hi all,

 

I just started using Power Automate and I'm trying to retrieve a copied file and send it per mail.

The flow copies a file from one location to another one on Onedrive and then needs to send the copied file to some users.

The first part works fine, but when I try to use "Get file content" from Onedrive for business it will throw error 400 every time.

Yvalson_0-1694436943396.png

The entire flow is not finished yet so that's why there is currently 2 branches.

Things I tried:

Creating a Test.xlsx file in Onedrive -> Selecting this file directly in Power Automate -> overwriting it with the flow -> gives error

Using dynamic content "Path" -> gives error

Writing the path manually -> gives error

using dynamic content "Id" -> gives error

using dynamic content "name" and manually writing path -> gives error

 

The weird thing is that I use the last method in the  Run script 2 action as well and it works completely fine.

Yvalson_1-1694438247029.png

I must be forgetting something in order to fetch the file correctly, but I don't know what it is.

  • Michael E. Gernaey Profile Picture
    44,142 Super User 2025 Season 1 on at
    Re: Badrequest error 400 Onedrive for business

    Morning

     

    You are using Get File Content, which is looking for the identifier not the path. If you want to use the path use Get File content with Path

     

    See my example below. where id and path both come from the Copy File action

     

    FLMike_0-1694447222408.png


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Badrequest error 400 Onedrive for business

    Hi @Yvalson 

     

    This is as per the design of "Get file" action of one drive connector. It accepts Id (Unique Identifier) of the file as input parameter to return the file content. Here are its details:

    OneDrive for Business - Connectors | Microsoft Learn

     

    Thanks

  • Yvalson Profile Picture
    5 on at
    Re: Badrequest error 400 Onedrive for business

    Thank you! worked immediately.

    Just one question though.

    What is the difference that makes the Excel script run using the dynamic content name while Get file content needs the Id?

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Badrequest error 400 Onedrive for business

    Hi @Yvalson 

     

    Pls pass the Id (unique identifier) from the "Create file" action in the "Get file content" to retrieve the content:

    ManishSolanki_0-1694444082948.png

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1