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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
stevenamani
Advocate II
Advocate II

Export Data from Visual

I am using the powerbi-client javascript library and working on exporting the underlying data behind a visual. In the 'rendered' event, I can successfuly pull the data and can inspect it in Chrome's debug console.

The problem I have however is that if I write the data to the page just using 'document.write(data)', the result doesn't seem to have any carrige returns or line feeds which are necessary to read into something like Excel. 

Is there a way around this?

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @stevenamani,

 

Did you try the demo here? And the source code? You can export a JSON type data. 

 

Best Regards,

Dale

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

I followed their example on the showcase page:

 

visuals[i].exportData(models.ExportDataType.Underlying)
.then(function (result) {
console.log(result.data);
})
.catch(function (errors) {
console.log(errors);
});

 

The result.data is just a long string and result has no other properties. Not sure how I would get JSON from this object.

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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