Jan 06, 2019 01:55 PM
The two fields I need from my base are ‘date’ and ‘venue’ and in the base they are in order by date, that’s how I entered them. When I i retrieve that data via the API, they are out of order, and not in a way that makes sense.
When I try to use the Airtable API Encoder to set the sort order, I get a 422 error. Any ideas how to fix this? Something simple that I’m missing?
Thanks!
Jan 08, 2019 04:19 AM
You are correct in using the “sort” parameter for sorting the retrieved data.
Could you please also share the “error message” you are receiving, it should hopefully provide some more insight as to what is going wrong.
Jan 08, 2019 07:28 PM
Here’s what I’m getting when I try to use the sort parameter. Without the parameter everything is returned correctly, though out of order.
Jan 09, 2019 05:33 AM
Pretty strange…It seems that your array of sort objects is perhaps malformed in your request url.
A work around to this is that you do not pass the sort parameter and create a view on your base that has the data ordered by date
You can then pass in the the above newly created view name as the value to the “view” parameter in the request
The data returned should be in the same order as they appear in that view.