Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Is there a way to retrieve the name of a visual on a report from a user click. I know i can call `report.getPages()` and then on a page do `page.getVisuals()` but ideally i would like to just pick up the visual name from a click, maybe a custom context menu option that could then pass it as a parameter to a function
To clarify the Playground shows the below code, but it does not show you how to get the VisualContainer4 value. That code assumes you know the visual name....
try {
const pages = await report.getPages();
// Retrieve the active page.
let page = pages.filter(function (page) {
return page.isActive
})[0];
const visuals = await page.getVisuals();
// Retrieve the target visual.
let visual = visuals.filter(function (visual) {
return visual.name === "VisualContainer4";
})[0];
const filters = await visual.getFilters();
console.log(filters);
}
catch (errors) {
console.log(errors);
}
Solved! Go to Solution.
In case anyone looks at this in the future, you can get the visual name throught the event parameter.
there is a visualClicked event you can subscribe to which then provides the visual details including the name.
In case anyone looks at this in the future, you can get the visual name throught the event parameter.
there is a visualClicked event you can subscribe to which then provides the visual details including the name.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |