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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
fairnie
Frequent Visitor

Accessing data from dataViews[0].table as object

I am trying to create a Power BI version of this (bumbeishvili/org-chart: Highly customizable d3 org chart. Integrations available for Angular, React,...) 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.
I have followed this (Using the `table` DataViewMapping in Power BI Custom Visuals | coacervo) and can access the data view in visual.ts with "options.dataViews[0].table.rows"

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: 
var data = [{id:'1',parentId:''},
            {id:'2',parentId:'1'}]
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. 

 
   
1 REPLY 1
fairnie
Frequent Visitor

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors