<?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 Accessing data from dataViews[0].table as object in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Accessing-data-from-dataViews-0-table-as-object/m-p/2891943#M6171</link>
    <description>&lt;P&gt;I am trying to create a Power BI version of this (&lt;A href="https://github.com/bumbeishvili/org-chart" target="_blank" rel="noopener"&gt;bumbeishvili/org-chart: Highly customizable d3 org chart. Integrations available for Angular, React, Vue (github.com)&lt;/A&gt;) after many false starts and errors I am almost there I just can't bind the data in a way that the visual will accept. I can pass in data as a hardcoded object which will generate the visual.&lt;BR /&gt;I have followed this (&lt;A href="https://coacervo.co/examples/table-dv-simple" target="_blank" rel="noopener"&gt;Using the `table` DataViewMapping in Power BI Custom Visuals | coacervo&lt;/A&gt;) and can access the data view in visual.ts with "&lt;SPAN&gt;options&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;dataViews&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;&lt;SPAN&gt;table&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;rows"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;as an array of arrays but I am not sure how I can manipulate it so that it is extracted in this format for the visual:&amp;nbsp;&lt;BR /&gt;var data =&amp;nbsp;&lt;SPAN&gt;[{&lt;/SPAN&gt;&lt;SPAN&gt;id&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;'1'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;parentId&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;''},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {id:'2',parentId:'1'}]&lt;BR /&gt;The array just has the columns named as 0 and 1 but I want to name the array items as id and parentId and then pass this as an object but I am not sure how to manipulate the array.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 08 Nov 2022 12:59:50 GMT</pubDate>
    <dc:creator>fairnie</dc:creator>
    <dc:date>2022-11-08T12:59:50Z</dc:date>
    <item>
      <title>Accessing data from dataViews[0].table as object</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Accessing-data-from-dataViews-0-table-as-object/m-p/2891943#M6171</link>
      <description>&lt;P&gt;I am trying to create a Power BI version of this (&lt;A href="https://github.com/bumbeishvili/org-chart" target="_blank" rel="noopener"&gt;bumbeishvili/org-chart: Highly customizable d3 org chart. Integrations available for Angular, React, Vue (github.com)&lt;/A&gt;) after many false starts and errors I am almost there I just can't bind the data in a way that the visual will accept. I can pass in data as a hardcoded object which will generate the visual.&lt;BR /&gt;I have followed this (&lt;A href="https://coacervo.co/examples/table-dv-simple" target="_blank" rel="noopener"&gt;Using the `table` DataViewMapping in Power BI Custom Visuals | coacervo&lt;/A&gt;) and can access the data view in visual.ts with "&lt;SPAN&gt;options&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;dataViews&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;&lt;SPAN&gt;table&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;rows"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;as an array of arrays but I am not sure how I can manipulate it so that it is extracted in this format for the visual:&amp;nbsp;&lt;BR /&gt;var data =&amp;nbsp;&lt;SPAN&gt;[{&lt;/SPAN&gt;&lt;SPAN&gt;id&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;'1'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;parentId&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;''},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {id:'2',parentId:'1'}]&lt;BR /&gt;The array just has the columns named as 0 and 1 but I want to name the array items as id and parentId and then pass this as an object but I am not sure how to manipulate the array.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Nov 2022 12:59:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Accessing-data-from-dataViews-0-table-as-object/m-p/2891943#M6171</guid>
      <dc:creator>fairnie</dc:creator>
      <dc:date>2022-11-08T12:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing data from dataViews[0].table as object</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Accessing-data-from-dataViews-0-table-as-object/m-p/2894914#M6186</link>
      <description>&lt;P&gt;I found my answer:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Developer/Field-order-change-issue-when-using-options-dataViews-0-table/m-p/356473#M10615" target="_blank"&gt;Solved: Re: Field order change issue when using options.da... - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 09:25:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Accessing-data-from-dataViews-0-table-as-object/m-p/2894914#M6186</guid>
      <dc:creator>fairnie</dc:creator>
      <dc:date>2022-11-09T09:25:26Z</dc:date>
    </item>
  </channel>
</rss>

