Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
WalterNC
Regular Visitor

DataSource.Error: Web.Contents failed to get contents from (400): Bad Request

Hi there,

 

I am trying to get my power bi dataset in a CSV using Flow/Power Automate.

I used this blog www.thebiccountant.com/  to create the query and the flow but i get DataSource.Error: Web.Contents failed to get contents from (400): Bad Request when i add the last step of the flow.

 

When a HTTP request is received =>

Compose using Json(decodeBase64(triggerBody()['$content'])) =>

Create CSV File 

Up to this stage my query:

let
Source = OData.Feed("https://XXXXXXX),
ToArray = Table.ToRecords(Source),
ToJsonBinary = Json.FromValue(ToArray),
WebCall = Web.Contents("https://prod-180.westeurope.logic.azure.com:443/workflows/XXXXXXXX", [Content = ToJsonBinary]),
LinesFromBinary = Lines.FromBinary(WebCall)
in
LinesFromBinary

Works but asoon as i add the Create File step in my flow i get the error DataSource.Error: Web.Contents failed to get contents from (400): Bad Request in my power query

 

What am i doing wrong please help

1 ACCEPTED SOLUTION

I fixed my problem 😀

 

I end my flow with HTTP that sends it to a new flow where i create my file on onedrive

This is what my flows look like:

 

To create the CSV:

WalterNC_1-1599829476074.png

 

To save it too onedrive:

WalterNC_0-1599829432843.png

 

View solution in original post

7 REPLIES 7
apoprio
Advocate I
Advocate I

Good Morning!
Well, in our process experience via Power Query (we use a lot of DATAFLOWS), we consolidate that this type of problem is intermittent, because this error rarely happens, in an already consolidated process!
in short:
It really seems to be something from the Power BI Service platform in terms of performance x capacity.

Greg_Deckler
Super User
Super User

@ImkeF @edhans 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @WalterNC ,

you have to use a tool like Fiddler to analyse what's being sent from Power Query and compare that with the requests from your endpoint (flow).

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

@ImkeF 

 

When i use fiddler i get {"error":{"code":"InvalidRequestContent","message":"The input body for trigger 'manual' of type 'Request' must be of type JSON, but was of type 'application/octet-stream'."}} as an error back

Hi @WalterNC ,

sorry, but I don't have more ideas here.

If you used the code provided with the "Json.FromValue" as the last function before putting it into the body, there must be something wrong with that function, actually.

But I don't have time currently to dig deeper into it, unfortunately.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

@ImkeF 

 

At thebiccountant they add outputs('Compose')['BinaryContent'] to the Create CSV but im not allowed to add ['BinaryContent'].

I get the error The template language expression 'outputs('compose')['BinaryContent']' cannot be evaluated because property 'BinaryContent' cannot be selected

 

Might this be the problem?

 

I fixed my problem 😀

 

I end my flow with HTTP that sends it to a new flow where i create my file on onedrive

This is what my flows look like:

 

To create the CSV:

WalterNC_1-1599829476074.png

 

To save it too onedrive:

WalterNC_0-1599829432843.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors