Hi all,
A connector is designed to fetch data from DOM instances. In the connector QAction, there is a need to filter instances where the value of a field in the instance is not included in the list of certain values.
It is something like:
var exludedList = new List<string>{value1, value2,};
var filter = DomInstanceExposers.FieldValues.DomInstanceField(fieldDescriptorId).IsNotContained(exludedList);
How can I construct such a filter?
I don't seem to find such a filter in this documentation. https://docs.dataminer.services/dataminer/Functions/DOM/DomHelper_class.html
Hi Fenta,
If I understand your use case correctly, you would like to only retrieve the DOM instances where a string value stored on the instance does not match any in a given list. Some kind of blacklist, so to say? If that is the case, you should be able to do so by creating an AND filter where each value is excluded using a 'NotEqual' filter.
var toExclude = new List<string> { "Value A", "Value B" };
var exclusionFilters = toExclude.Select(one =>
DomInstanceExposers.FieldValues.DomInstanceField(fieldDescriptorId).NotEqual(one));
var finalFilter = new ANDFilterElement<DomInstance>(exclusionFilters.ToArray());
Do keep in mind to not make this list too long as this will impact the filter performance. Also, on locally hosted DBs, you may run into a limit. It is recommended to keep the amount of excluded strings below 500 or so.


Yes, exactly! Apologies for the typo. I have updated my reply.
Thank you Thomas. That is the use case. As you said the challenge will be that the toExclude list might get larger. I will test this approach.
Small correction: in the expression, it should be .NotEqual(one) instead of .NotEqual(toExclude), right?