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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
custom-visuals
Regular Visitor

Retrieve Formatting objects for tableDataView Rows

Hey guys, 

I'm trying to get formatting objects for rows in a table dataView.
First, I create a row selector and add it to the transformed model.

 

let eventSelection = this.host.createSelectionIdBuilder()
   .withTable(tableDataView, j)
   .createSelectionId();

 

Also I create colors for each selected row:

 

let color;
if(this.sett.colors.autoColor.value) {
	color = colors[j];
} else if(this.sett.colors.isSingleColor.value) {
	color = this.sett.colors.defaultColor.value;
} else if(tableDataView.rows[j].objects) {
	color = tableDataView.rows[j].objects["colors"]["eventColor"]["solid"]["color"]
} else {
	color = colors[j]
}

let ids;
roles.forEach(r=> {
	let role = r.role;
	if(role == "events") {
		let val = tableDataView.rows[j][r.index];
		ids = {"selection": eventSelection, "event": val, "color": color};
	}
})
dv.id.push(ids);


Then, I populate the enumerateObjectInstances format bar in the following way:

 

case 'colors':
	if(this.allData) {
		for(let row of this.allData.id) {
			properties.push({
				objectName: propertyGroupName,
				displayName: row.event,
				properties: {
					eventColor: row.color
				},
				selector: row.selection.getSelector()
			})
		}
			
	}
break;

 

The formatting options appear fine, I take the values of the rows of one of the columns as the displayed values.
The problem is that when choosing a color for my "rows" I don't see these objects in the dataView. That is, I assume that they should appear somewhere here -

tableDataView.rows[i].objects

but there is nothing there.

 

The selectors show the correct identityIndex , but there are no objects in the model for them.

 

Result of row.selection.getSelector():
 

customvisuals_0-1678305294275.png

 

dataView 

customvisuals_1-1678305454249.png

 

Formating panel:

customvisuals_2-1678305593846.png

 

 

 

 

0 REPLIES 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors
Top Kudoed Authors