Capsule API Filter Order by

78 views
Skip to first unread message

Marco Klemm

unread,
Sep 11, 2019, 4:11:12 AM9/11/19
to Capsule API
Hello,

I'm using the filter endpoint of the API.


How can I retrieve persons and order by organisation name? I've tried the field names of the filter reference:


{ "filter": { "conditions": [ { "field": "type", "operator": "is", "value": "person" } ], "orderBy": [ { "field": "org.name", "direction": "ascending" } ] } }

...but get the following error message:

{"message":"invalid orderBy field 'org.name'","resource":"filter","field":"orderBy"}]}


Thanks in advance!

Best Regards,
Marco

Frankie McGough

unread,
Sep 11, 2019, 4:25:41 AM9/11/19
to Capsule API
Hi Marco,

To get people ordered by their organisation name, you would use a filter like this:

{ "filter": { "conditions": ..., "orderBy": [{ "field": "organisationName", "direction": "ascending" }] } }

Hope this is helpful, please shout if you have any further issues.

Frankie

Marco Klemm

unread,
Sep 15, 2019, 9:22:57 AM9/15/19
to Capsule API
Hi Frankie,

thanks a lot! Works like a charm.

Marco

Marco Klemm

unread,
Sep 16, 2019, 2:44:56 AM9/16/19
to Capsule API
Hello,

I have another question regarding filtering. Is ist possible to order by a custom field?

I've tried the full name of the tag field "<label>.<field>" and the syntax of the conditions "custom:<id>", but get the error message:

[{"message":"Validation Failed","errors":[{"message":"invalid orderBy field 'custom:54678'","resource":"filter","field":"orderBy"}]}] 

Thanks a lot!

Best Regards,
Marco




--
You received this message because you are subscribed to the Google Groups "Capsule API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capsule_api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capsule_api/ffa4797d-d4c9-45e1-8cbe-c4690191770e%40googlegroups.com.

Capsule API

unread,
Sep 16, 2019, 4:55:07 AM9/16/19
to Capsule API
Hi Marco,

I'm afraid it's not currently possible to order by a custom field. The best I can suggest is to grab the data and then do the ordering locally via your code.

It is something that has been requested by a number of customers, so I've added a vote and a link to this conversation so it can be considered when the feature request is reviewed internally.

Cheers,
Adam
Reply all
Reply to author
Forward
0 new messages