Forum Discussion

PimK's avatar
PimK
Frequent Visitor
2 years ago

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.

 

 

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

    • PimK's avatar
      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.

       

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

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