Additional_sort_fields error

Hi, I have an endpoint called price. I want to sort data from this end point using two fields: productCode and categoryIndex. ProductCode is the primary sort field and its working fine. But when I add additional field as per bubble reference guidelines Introduction - Bubble Docs I get below error
{“statusCode”:400,“body”:{“status”:“INVALID_DATA”,“message”:“Issue with data for endpoint price: undefined cannot be parsed as a JSON”}}

Where could the problem be?

@simon7 can you help me out here please.

Hi, sorry for late reply, am on maternity leave these days so not at a computer. Haven’t used sort/additional sort yet so can’t help out right now.

Edit just reread documentation and as I read it your parameter needs to be “sort_field” and the value needs to be additional_sort_field: [{…}}]

Hi both,

Did you get this issue resolved as I also get a 404 if I try and use the sort_field parameter with an additional_sort_field: [{…}] value.

Thanks

Bump, has anyone figured this out? Here’s what my array looks like. The sort_field parameter/value works, but when I add in the additional_sort_fields parameter with the array, I get the JSON parsing error.

image

I’m also getting this error…

It seems like it’s an issue in the Bubble API itself

Hi all,
It’s work if you remove all space and add " around key and value parameters. So clean and check your constraint expression :slight_smile: