According to the official documentation:
Filters startsWith, notStartsWith, contains, notContains are only supported for strings.
Therefore, if your field is a string field, it should definitely work. However, the only reason I can think this will not work, is if you are applying a filter on top of another filter without clearing the previous filter first. I.e., If you run the following code:
var datasource = widget.datasource;
datasource.query.filters.readByUsers._contains = 'Susanne';
datasource.load();
It will only return results where the field readyByUsers contains the string Sussane
. If after that you run the code:
var datasource = widget.datasource;
datasource.query.filters.readByUsers._notContains = 'Susanne';
datasource.load();
It will return zero results because all the records loaded contain the string Susanne
. Hence it might give you that effect that it is not working when indeed is.
To make sure that your filters work properly, you first need to clear the previous filter before applying a new one, unless you explicitly want to apply a second filter on top of the first one. For that, you need to run the clearFilters method. So your code should look like this:
var datasource = widget.datasource;
datasource.query.clearFilters();
datasource.query.filters.readByUsers._contains = 'Susanne';
datasource.load();
Or like this:
var datasource = widget.datasource;
datasource.query.clearFilters();
datasource.query.filters.readByUsers._notContains = 'Susanne';
datasource.load();