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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
technerd01
New Member

Exporting data from a custom visual using powerbi-client javascript library

Hello Team,

 

I have custom visual which is built on a HTMLTextAreaElement. The use case is, user should be able to enter any value in this custom visual and using powerbi-client javascript library I need to read the value from this custom visual.

 

var inputTextCustom = visuals.filter(function (visual) {
return visual.type === "inputTextXXXXXXX" && visual.name === "YYYYYYYYYYY";
})[0];

 

I am able to access the custom visual using the above code but I am unable to read the value from it.

 

I have tried using the below code to extract the data from the custom visual, but it does not work.

 

inputTextCustom.exportData(models.ExportDataType.Underlying, 500).then(handleExportData);

 

function handleExportData(result) {
   const resultData = parseData(result.data);
   console.log(resultData);
}

function parseData(data) {
   const result = [];
   data.split("\n").forEach(function (row) {
   if (!row) {
      return;
   }
   const rowArray = [];
   row.split(",").forEach(function (cell) {
   rowArray.push(cell);
   });

   result.push(rowArray);
});
return result;
}

 

Can someone please guide me with some sample code on how should I go about extracting the data from this custom visual?

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @technerd01 ,

 

Power BI custom visuals and R visuals aren't currently supported to use export function in Power BI. Here I suggest you to try Power BI Rest API to export data from custom visual.

For reference: 

Exporting a page or a single visual

Depending on the type of export, you need to pass different attributes to the ExportReportPage object. 

 

Best Regards,
Rico Zhou

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @technerd01 ,

 

Power BI custom visuals and R visuals aren't currently supported to use export function in Power BI. Here I suggest you to try Power BI Rest API to export data from custom visual.

For reference: 

Exporting a page or a single visual

Depending on the type of export, you need to pass different attributes to the ExportReportPage object. 

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.