<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Exporting data from a custom visual using powerbi-client javascript library in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Exporting-data-from-a-custom-visual-using-powerbi-client/m-p/2283160#M33876</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/350983"&gt;@technerd01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;For reference:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to#exporting-a-page-or-a-single-visual" target="_self"&gt;Exporting a page or a single visual&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Depending on the type of export, you need to pass different attributes to the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofile#exportreportpage" data-linktype="absolute-path" target="_blank"&gt;ExportReportPage&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;object.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jan 2022 07:06:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-01-14T07:06:50Z</dc:date>
    <item>
      <title>Exporting data from a custom visual using powerbi-client javascript library</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Exporting-data-from-a-custom-visual-using-powerbi-client/m-p/2278131#M33841</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have custom visual which is built on a&amp;nbsp;HTMLTextAreaElement. The use case is, user should be able to enter any value in this custom visual and using&amp;nbsp;&lt;SPAN&gt;powerbi-client javascript library I need to read the value from this custom visual.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var inputTextCustom = visuals.filter(function (visual) {&lt;BR /&gt;return visual.type === "inputTextXXXXXXX" &amp;amp;&amp;amp; visual.name === "YYYYYYYYYYY";&lt;BR /&gt;})[0];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am able to access the custom visual using the above code but I am unable to read the value from it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried using the below code to extract the data from the custom visual, but it does not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;inputTextCustom.exportData(models.ExportDataType.Underlying, 500).then(handleExportData);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function handleExportData(result) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;const resultData = parseData(result.data);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;console.log(resultData);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function parseData(data) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;const result = [];&lt;BR /&gt;&amp;nbsp; &amp;nbsp;data.split("\n").forEach(function (row) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if (!row) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp; &amp;nbsp;const rowArray = [];&lt;BR /&gt;&amp;nbsp; &amp;nbsp;row.split(",").forEach(function (cell) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;rowArray.push(cell);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;});&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;result.push(rowArray);&lt;BR /&gt;});&lt;BR /&gt;return result;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please guide me with some sample code on how should I go about extracting the data from this custom visual?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 18:04:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Exporting-data-from-a-custom-visual-using-powerbi-client/m-p/2278131#M33841</guid>
      <dc:creator>technerd01</dc:creator>
      <dc:date>2022-01-11T18:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting data from a custom visual using powerbi-client javascript library</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Exporting-data-from-a-custom-visual-using-powerbi-client/m-p/2283160#M33876</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/350983"&gt;@technerd01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;For reference:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to#exporting-a-page-or-a-single-visual" target="_self"&gt;Exporting a page or a single visual&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Depending on the type of export, you need to pass different attributes to the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofile#exportreportpage" data-linktype="absolute-path" target="_blank"&gt;ExportReportPage&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;object.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 07:06:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Exporting-data-from-a-custom-visual-using-powerbi-client/m-p/2283160#M33876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-14T07:06:50Z</dc:date>
    </item>
  </channel>
</rss>

