How to use `sort` parameter in KoboToolbox API? What field types are supported?

Hi Kobo Community,

I’m currently enhancing our KoboToolbox connector to support sort query params. I was reading api documentation for querying submitted data and found a docs link for supported API Parameters, But I need a bit of clarification on the following

  1. Which field types are supported for sorting? Can we sort by string, date, and numeric fields—or is it limited to certain types like date and number?. Eg: sort string type field {'sort': '{"name": -1}'}. Is this possible ?

  2. Are there any limitations or considerations when sorting by custom fields from the form?

Any guidance, documentation links, or examples from others who’ve implemented sorting would be super helpful.

Thanks in advance!

Welcome back to the community, @mtuchi! Could you kindly share with us the API that you want to query? We could then share with you some workarounds it it’s possible through KoboToolbox.

Hiya @Kal_Lam
This is just an example of fetching form submissions and sort the results in descending order using name field

GET: /api/v2/assets/aXecHjmbATuF6iGFmvBLBX/data, query param {format: 'json','sort': '{"name": -1}'}.
So my assumption is name is string type field, So the result will be arranged in alphabetical order. Is this the right assumption ?