This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
I am trying to get a state from a slicer using getSlicerState but I am getting the error below:
TypeError: Cannot read property 'contract' of null
at e.getExploration (reportEmbed.slicer-api.min.js:1)
at e.tryGetVisualContainer (reportEmbed.slicer-api.min.js:1)
at e.<anonymous> (reportEmbed.slicer-api.min.js:1)
at reportEmbed.slicer-api.min.js:1
at Object.next (reportEmbed.slicer-api.min.js:1)
at reportEmbed.slicer-api.min.js:1
at new r (powerbiportal.dependencies.bundle.min.js:13)
at p (reportEmbed.slicer-api.min.js:1)
at e.handleSlicerRequest (reportEmbed.slicer-api.min.js:1)
at e.<anonymous> (reportEmbed.slicer-api.min.js:1)
This is my code:
this.report.getPages().then(pages => {
let pageActive = pages.filter(page => page.isActive)
if (pageActive[0]){
pageActive[0].getVisuals().then(function(visuals) {
console.log(visuals.filter(visual => visual.title === 'Basket'));
visual = visuals.filter(visual => visual.title === 'Basket');
visual[0].getSlicerState()
.then(state => {
console.log(state)
});
});
}
});
Does anyone know what this issue is?
visual[0] is a VisualDescriptor. It is supposed to work straightaway.
Thanks
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.