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
PimK
Frequent Visitor

Getting data with JSON body in M

Hello there,

 

I hope you can help me with the following problem as I have no single experience in working with JSON body in the script editor.

Below code worked all fine, but lately I've been receiving an error that an 'scode' exceeds the maximum file size. 

To resolve this problem, I have added the marked lines (in blue) to the code and put 'body' in the code instead of 'postData' (highlighted in orange).

The code is working in Postman, but Power BI gives an 500 Internal Server Error.

 

PimK_1-1695045644519.png

 

Can you tell me what I'm doing wrong?

I have tried several adjustments (like working with Json.FromValue), but no luck.

Thanks in advance.

6 REPLIES 6
lbendlin
Super User
Super User

Please follow the documentation

Web.Contents - PowerQuery M | Microsoft Learn

Json.FromValue and Text.ToBinary use different syntax.  

PimK
Frequent Visitor

Thanks for the response.

 

I've already looked into the documentation and understand the difference in syntax with using different functions. However, the documentation doesn't give me new insights in solving the problem. Frankly, I was surprised the above code results in an error.

 

content = Json.FromValue([reportParameters=[limit_from = 1, limit_amount = 10]])

PimK
Frequent Visitor

Tried that before as well, but still the 500 error shows up.

As you can imagine it is nearly impossible to help with API related issues without access to said API. Do they have a demo key?

PimK
Frequent Visitor

Unfortunately there's no demo key.

I'll just keep trying to sort this out. Learning by doing 😉

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.