Forum Academy Marketplace Showcase Pricing Features

API Constraint "contains" on Option Set Value

I have a pretty long set of constraints on a API data call. One data field is a list of values of an option set (status values). I want to filter to check if a record contains a specific option set value.
A record has a field that is a list of option set values.
On screen if a checkbox is set then a specific option set value is added to a custom state list of option set values.

Essentially this sets up for a list included in list filter but that is a filter thing and because I am paging and for performance reasons I am doing a poor man’s version of this whereby I have multiple constraints of form: “field contains customState#item 1”

My problem is that the constraint entry field is text (probably because the API call is text) and it will not allow me to set “value” : “optionSetValue” i.e…

{"key": "status_tags",
"constraint_type":  "not contains",
"value": "[volunteer list excludes_tags #item 1]"

The #item 1 is not text so unhappy. Now if I was referring to a table item I could just use the uniqueId value and that seems to work fine but there is no uniqueId (that I can find) for option sets.

I guess I am asking if this is possible - the documentation implies it is…

contains or not contains Use to test whether a list field contains an entry or not, for list fields only.


Okay so I looked at the JSON returned and realised that the record was just storing the option set display value (key) as a string so am now happily using the constraint exactly as I was doing on actual list of text field. In the case, the text is the option set display value.