Hello,
I am am new and using the Baserow cloud version (baserow.io) and am having trouble with the API for my table.
My Table ID is: 641145
A simple request to list rows works perfectly. This request succeeds:
GET /api/database/rows/table/641145/?user_field_names=true
However, the moment I add any order_by or filters parameter, the API returns a 500 Internal Server Error.
For example, this request fails with a 500 error, even though sorting by id should always work:
GET /api/database/rows/table/641145/?user_field_names=true&order_by=-id
This also fails with a 500 error, even with a valid filter confirmed from the API docs:
GET /api/database/rows/table/641145/?user_field_names=true&filters={“filter_type”:“AND”,“filters”:[{“type”:“equal”,“field”:“field_5235549”,“value”:“Approved”}]}
It seems like my table is not responding correctly to any sorting or filtering requests via the API. Could you please help me understand why this might be happening?
Thank you.
The reason why the id order_by is not working is because id is not a valid field. To sort by id, you should create a formula field and use the row_id() function in the formula to get that row’s id and then use this field in your order_by request.
The reason the filter is not working is because the ,“field”:“field_5235549” in your request is wrong. It should be ,“field”:5235549 (Should be an integer, not a string). IT should only be a string if you have user_field_names set to true, in which case you would be using that field’s actualy name on not the field_id value of it anyway.