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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
vfx661
Advocate I
Advocate I

How to make the config multiple lines in report.json for pbip format?

When saving as a pbip and opening report.json with vscode, it has a long line of code at the top and throughout the code for the "config" key items.  Is there a way to make these split onto multiple lines for readability?


In below picture, one of these is underlined in red with an arrow indicating the line keeps going a very long way - I believe these are also called 'code walls' because they are somewhat inpenetrable to usability.
vfx661_0-1721690624576.png

 


 



 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @vfx661 ,Hello  @RossEdwards  ,Thank you for your prompt reply!

 

We could also convert an escaped JSON string to a standard format in Visual Studio Code, you can follow the steps below:

 

  • In VS Code, create a new JavaScript file (e.g. formatJson.js):
const escapedJsonString = "{\"name\":\"2816855a60051136b63a\",\"layouts\":[{\"id\":0,\"position\":{\"x\":20.6873,\"y\":330.27,\"z\":7000.00}}]}";
const jsonObject = JSON.parse(escapedJsonString);

const standardJsonString = JSON.stringify(jsonObject, null, 2);

console.log(standardJsonString);  
  • Then Save the file and run it manually in a terminal:
node c:\Users\Administrator1\Desktop\formatJson.js​
  • Then the result will show as below:

vyajiewanmsft_0-1721713610813.png

 

Best regards,

Joyce

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @vfx661 ,Hello  @RossEdwards  ,Thank you for your prompt reply!

 

We could also convert an escaped JSON string to a standard format in Visual Studio Code, you can follow the steps below:

 

  • In VS Code, create a new JavaScript file (e.g. formatJson.js):
const escapedJsonString = "{\"name\":\"2816855a60051136b63a\",\"layouts\":[{\"id\":0,\"position\":{\"x\":20.6873,\"y\":330.27,\"z\":7000.00}}]}";
const jsonObject = JSON.parse(escapedJsonString);

const standardJsonString = JSON.stringify(jsonObject, null, 2);

console.log(standardJsonString);  
  • Then Save the file and run it manually in a terminal:
node c:\Users\Administrator1\Desktop\formatJson.js​
  • Then the result will show as below:

vyajiewanmsft_0-1721713610813.png

 

Best regards,

Joyce

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @Anonymous that's given me a great idea - your solution works fine - just wanted something faster.  I've got python/R, so load up a json parsing library and create a function that converts to pretty format without saving and running files.

I've also discovered PBIR format option - that's what I really want to use - if only it published at a button press instead of forcing me to use fabric git integration 👹

RossEdwards
Solution Sage
Solution Sage

Have you tried copying and paste the code into a JSON formatter tool online?  Thats generally what I do when i'm trying to read the JSON outputs.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.