Forum Discussion

GregBoet's avatar
GregBoet
Frequent Visitor
2 years ago

Error "slicerSerializationFailed" when calling getSlicerState()

I’m embedding a Power BI report in a web application, and I am generally able to use Javascript to read the user-selected values in the report’s slicers.

 

In Javascript, I am simply calling

state = await slicer.getSlicerState();

 

This works for most slicers, but one of our slicers allows the user to choose one or more values from a hierarchical tree (screenshots below). This sometimes works and sometimes does not, depending on what the user chooses. Scenarios 1 and 2 below work, but Scenario 3 throws an error (details below).

 

The error message I’m getting back makes this sound like a bug rather than simply an omitted feature. Is this a bug that will be fixed? Is there a workaround?

 

1.

If the user selects a single checkbox at the parent level, I can use Javascript to get the following slicer state filter. Everything is good.

{"$schema":"http://powerbi.com/product/schema#basic","target":{"table":"clm Locations","column":"Level"},"filterType":1,"operator":"In","values":["3"],"requireSingleSelection":false}

 

 

2.

If the user selects a single checkbox at the child level, I can use Javascript to get the following slicer state filter. Everything is good.

{"$schema":"http://powerbi.com/product/schema#tuple","target":[{"table":"clm Locations","column":"Level"},{"table":"clm Locations","column":"LocationName"}],"filterType":6,"operator":"In","values":[[{"value":"3"},{"value":"CEMETERY-341"}]]}

 

3.

If the user selects all but one or two values at the child level, calling Javascript to get the slicer state throws an exception.

Exception thrown is as follows:

{message: 'slicerSerializationFailed', detailedMessage: 'Failed to serialize slicer filters to json object', level: 3}

 

2 Replies

  • GregBoet's avatar
    GregBoet
    Frequent Visitor

    Although this answer does help, I am not sure that the documentation says that this functionality is not supported. On the contrary, it says that hierarchy slicers are supported, yet this is not working. Is there a place where I can report this as a bug to be fixed?