Hello community!
I'm trying to filter contacts by unique keys from another system.
Currently, we are using 'eq' and 'or', but that has a limitation (the error states that only 100 nodes are supported in a filter).
After reading the oData 4.01 documentation that is linked in the creatio documentation here https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/architecture/development-in-creatio/integrations#title-2088-10, I found the "in" operator, which might bypass this issue completely, so we wouldn't need to page through records.
However, I couldn't get it to run...my filter looks like this:
$filter=["QsTbisKey"] in ["47928","50447"]
But it returns an error:
{ "error": { "code": "", "message": "An error has occurred.", "innererror": { "message": "The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; odata.metadata=none'.", "type": "", "stacktrace": "", "internalexception": { "message": "Object reference not set to an instance of an object.", "type": "", "stacktrace": "" } } } }
I tried using all combinations of other brackets and single quotes but was unsuccessful.
Does anyone know how to do this?
Thanks and BR,
Robert
Like
Hello,
The 'in' operator is not supported in OData 4 in Creatio.
At the moment, it is possible to use the operators that are available in the examples in the official Postman collection of the Creatio API.
We have registered a task to improve this functionality ('in' operator for Creatio OData 4 requests) in future releases of Creatio.
Correct filter for In operator OData 4.01 is usually like:
filter=Id in ('6f2efedd-9b25-43b4-9cb9-0ebe60a02a8a','72509ae9-7065-465c-b7c5-3d193b8fe768')
However, it produces the same result with Creatio OData. It's possible Creatio only implements OData 4.0 and not 4.01 (which introduced the In operator).
Might need a different approach like a configuration service that takes the like of values as a param and returns the results? Or if it would work to create a common parent record of the values that could be used to retrieve the results?
Ryan Farley writes:
Correct filter for In operator OData 4.01 is usually like:
filter=Id in ('6f2efedd-9b25-43b4-9cb9-0ebe60a02a8a','72509ae9-7065-465c-b7c5-3d193b8fe768')
However, it produces the same result with Creatio OData. It's possible Creatio only implements OData 4.0 and not 4.01 (which introduced the In operator).
Might need a different approach like a configuration service that takes the like of values as a param and returns the results? Or if it would work to create a common parent record of the values that could be used to retrieve the results?
Hi Ryan,
I did try that syntax already, but it didn't work.
Maybe someone from Creatio can shed some light on the implemented OData version?
Thanks,
Robert
Hello,
The 'in' operator is not supported in OData 4 in Creatio.
At the moment, it is possible to use the operators that are available in the examples in the official Postman collection of the Creatio API.
We have registered a task to improve this functionality ('in' operator for Creatio OData 4 requests) in future releases of Creatio.
Serhii Parfentiev,
Thanks for the information!
Since the documentation I linked explicitly points to the OData 4.01 version, it should be updated and the exact version should be mentioned to know what is supported and what is not.
Thanks,
Robert