I'm attempting to set a slicer value upon load leveraging the App Owns Data example. however I cant seem to get it to work using setSlicerState(filter).
i've tried to create a slicerstate object and update it using the setSlicerState function, however am getting an error :
DOMException: Failed to execute 'postMessage' on 'Window': #<Promise> could not be cloned
See my code below:
report.getPages()
.then(function (pages) {
//go to page 5 and get slicer visual
testPage = pages[5];
testPage.getVisuals()
.then(function (visuals) {
testSlicer = visuals[0];
//get slicer state object
testState = testSlicer.getSlicerState();
}).catch(function (errors) {
console.log(errors);
});
});
report.getPages()
.then(function (pages) {
// Retrieve page 4
testPage = pages[4];
//go to page 4
testPage.getVisuals()
.then(function (visuals) {
testSlicer = visuals[2];
//Set slicer state to value from previous visual
testState = testSlicer.setSlicerState(testState);
}).catch(function (errors) {
console.log(errors);
});
});Has anyone had experience with this? or am able to point me in the right direction?
Thanks