Get Free Trial

Custom Data Source API: how does the Filter object get used recursively?

Answered asked on May 25, 2020

Looking at the current documentation for the Custom Data Source API in order to implement it in my project ( The Filter object is defined recursively:

"field": FieldObject,
   "include"[]: {
"member": string | number,
"filter": FilterObject
   "exclude"[]: {
"member": string | number,
"filter": FilterObject
   "query": {
       (condition): string | number | string[] | number[]
   "value": {
       "field": FieldObject,
       "func": string

Filter and Filter.include[0].filter have the same schema/are the same type.

It isn’t made clear anywhere how this is actually used, and the only explanation we have to go by is that this nested filter “specifies which filters should be applied to the member.”

What is a use case for the nested filter property in either the include or the exclude properties of the filter?

2 answers

Mykhailo Halaida Mykhailo Halaida Flexmonster May 26, 2020

Thank you for posting your question.
The mentioned recursion in the structure of the Filter object for the custom data source API is necessary for use cases when the query is carried out on the multilevel hierarchies. This approach allows the filter to be applied to the lower levels of the hierarchy as well.
Also, we would like to mention the advanced option of the /fields request, which, depending on its value, enables or disables filtering for multilevel hierarchies. More info on this can be found by the following link:
Please let us know if this helps.
Best regards,

Public May 27, 2020

Okay, thank you that makes sense now. It will probably help future users to have that explanation in the documentation 🙂

Please login or Register to Submit Answer