[IMPLEMENTED] Ensure consistent order

I’m not sure what’s going on here and i’ve might have ran into a bug. I’m collecting data from a 3rd party api and then im storing it programatically in a multi content Squidex schema, each object in the array is created as it’s own item in squidex. It kinda works but i’m getting a pretty weird sorting of the items in Squidex and i’m not sure why. The order of the items in Squidex is not the same as in the array i’m posting to Squidex (it’s not toally random and it’s consistantly the same if i remove and recreate the items).
However, if I in the Squidex admin interface sort the schema by “lastModified” the order becomes correct. If i in postman do a get request to the schema the order is incorrect. I’m not really sure what decides the order in squidex but something is weird here.

As a solution i started to think if it’s possible to query a schema by “lastModified”? I’ve read the docs here https://docs.squidex.io/02-documentation/developer-guides/api-overview/api and I’ve written a few queries before but can’t manage to get this one working, is it even possible?

If you are inserting items programmatically, the lastModified property might be the same for some of these items. Therefore the sort order is undefined. I am thinking about sorting by id as well in this case.

Yeah I noticed that when I checked the data in postman but that does not answer the question why the order is correct when I sort it by lastModified in the admin interface? Also, do you have any other suggestion how I get the order correctly?

You can try to sort by lastModified and then by id

Yeah that was kinda included in my first question, how the query should look but i think i got it correct now, thank you

This topic was automatically closed after 2 days. New replies are no longer allowed.