Like what you see? Have a play with our trial version.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Corrected error in setPossibleValues code.

...

let possibleValues = filter.possibleValues;
possibleValues.push({
    value: 'Relaxation',
    description: 'Relaxation'
});
filter.setPossibleValues(possibleValues = possibleValues);


Override the entire possible values array with values of your own:

let possibleValues = [];
possibleValues.push({
    value: 'FIRST', //The data that is stored in the table for this filter is upper case.
    description: 'First' //Upper case can be painful to read, so put a more readable version to be displayed in the description
});

possibleValues.push({
  value: 'SECOND',
  description: 'Second'
});

filter.setPossibleValues(possibleValues = possibleValues);

Notes/Limitations

If the filter is part of a filter hierarchy any values you set through this property will be overwritten when the parent filter changes and pushes new values into this filter. 

...