invalid sortBy properties

I keep getting “Query contains invalid SortBy properties.” when trying to run a query with sortBy.

I have a table where i have a relation to an object in another table.

Table Person
|name|otherProperties|

Table OtherProperties
|example1|SKU

i need to make a query to the table person and sort the results by the SKU item in the table otherProperties.

This is my current query

var dataQuery = { condition: “name =Mark”, options: {pageSize:100, sortBy:“OtherProperties.SKU”}};

There is no actual example in the JS documentation on how to do the query, so all help will be appreciated.

Hi Nicolas,

the “sortBy” property should be an array. Try this instead:

var dataQuery = { condition: "name =Mark", options: {pageSize:100, sortBy:["OtherProperties.SKU"]}};

Regards,
Mark

Still no luck :confused:

The actual table is called ValorProductosSucursal. The relation goes to a table called Productos (referenced in ValorProductosSucursal as SKU) and the element i want to sortby is a double named SKU.

Here is the full query

var ProductosSucursalRaw = Backendless.Persistence.of(ValorProductoSucursal);
var dataQuery = { condition: "ID_SUCURSAL.ID_SUCURSAL = 12000", options: {pageSize:100, sortBy:["SKU.SKU"] }};


    ProductosSucursalRaw.find(dataQuery,new Backendless.Async(...

Could you attached the screenshots of the Person and OtherProperties schemas?

ValorProductosSucursal:
http://support.backendless.com/public/attachments/c9bfac0c84e0e12156ec04e3ea0e10fb.JPG</img>

Productos
http://support.backendless.com/public/attachments/5ccb1ad61bd2a2bd054b8d329205302c.JPG</img>