Re: How can I un-select all selections before setting new selection via api
Just to add to this answer, setting the third parameter to true, as such:
backendApi.selectValues(dim, [value], true);
Will not only add any new selections made to previously selected items, but also will de-select/unselect any selections made that are already in the current selection. i.e. when set to true, if the user clicks on an item that is already selected then this item will be removed from the current selection.