sortOrder TrackedEntityInstance doesn't work

Hi All,

I’ve confuse how to order the EnrollmentDate DESC with this web api?

https://server/api/trackedEntityInstances.json?fields=[enrollments]&program=QqodHvGgDrq&ou=IU2HDuYpTnY&attribute=e25qAod3KTg,quJD4An7Kmi,taFkwTiKFyR,GdwLfGObIRT,mHwPpgxFDge,YlOp8W4FYRH,+xu1Ukzi0PMJ,+fk5drl1hTvc,vyWUq8BAnwg&programStatus=ACTIVE&sortOrder=enrollmentDate:DESC&page=1&pageSize=5&programStartDate=2021-08-01&programEndDate=2021-08-31&lastUpdatedStartDate=2021-08-01&&lastUpdatedEndDate=2021-08-31&sort=created:desc

and result is:

and this result is strange. Is anyone to support how to order the enrollment date DESC?

Hi @taufiqhs,
Sorry, what version are you using? I see that you are using sortOrder=property:desc instead of order=property:asc as mentioned in the docs.

Additionally, what do you think “only properties that are both persisted and simple (no collections, idObjects etc) are supported.” means? property “created” works when I use it but other properties such as enrollmentDate don’t work, and I’m guessing that it could be the reason that they aren’t supported properties for the order parameter?

I’m still waiting for a response; however, we might eventually need to create a feature request to support that property? What do you think?

Thanks!

Hi @Gassim

we are using 2.36.3 version

1 Like