How to sqlfilter array_options/complementary attributes/extrafields

I finally figured out how to use sqlfilters in the API to search in array_options/complementary attributes/extrafields, so in case anyone else ever needs to understand how to correlate

  • extrafield which is called Complementary attributes in the module configuration, and array_options in the json, and __EXTRAFIELD_ when sending emails.
  • Complementary attributes as defined under a module, in this case the product module
  • sqlfilters in the API
  • keys in the json exported by the API

Screenshot of definition of an Complementary attribute

So as you can see I have one defined which I call service_type and which values I allow it to have.

sqlfilters
In the API under the sqlfilters field I would write this

(ef.service_type:like:'Workshop')

JSON output
In the resulting JSON output I would get something like this

    "array_options": {
      "options_service_type": "Workshop",

You can also combine multiple queries in the sqlfilters field like this

(t.tosell:=:1) and (ef.service_type:like:'Workshop')

I also updated the wiki here