Forum Discussion
SlicerCache.VisibleSlicerItems vs Sliceritem
- Anwesh GangulaJul 23, 2018Iron Contributor
"slicer. SlicerItems.Selected" is not just for the items that are selected, it also works the other way around. If it's value is set to true, it means the item is selected and if it is false, it means the item is deselected.
And "slicer. SlicerItems.Selected" can be used for chosen items(all the items of the slicer does not have to be specified). But for "VisibleSlicerItemsArray" all the items of the slicer need to be verified.
So the issue in my case is when I use "slicer. SlicerItems.Selected", I can specify 2 items that I want to deselect and set their value to false and it works perfectly fine. But when "VisibleSlicerItemsArray" is used, we need to specify all the items that need to be selected. The items on my slicer are dynamic. So there no specific list that I can input in the array.
For Example:
If is use
.ClearManualFilter
.SlicerItems("Item1").Selected = False
.SlicerItems("Item2").Selected = Falseit works the way I need it to by deselecting just item1 and item2 and selected everything else. I cannot do the same using VisibleSlicerItemsArray.