How to orderby/sorting query builder result using node's property? | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Saravanan_Dharmaraj

@ferosekhan Please see an example of sort for lastReplicated property. You can se

 

path=/content/we-retail
type=cq:Page
orderBy=@jcr:content/cq:lastReplicated
orderby.sort=desc

 

https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/query-builder/querybuilder-predicate-reference.html?lang=en#orderby - Documentation

2 replies

Saravanan_Dharmaraj
Community Advisor
Saravanan_DharmarajCommunity AdvisorAccepted solution
Community Advisor
March 30, 2023

@ferosekhan Please see an example of sort for lastReplicated property. You can se

 

path=/content/we-retail
type=cq:Page
orderBy=@jcr:content/cq:lastReplicated
orderby.sort=desc

 

https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/query-builder/querybuilder-predicate-reference.html?lang=en#orderby - Documentation

Abhishekty
Level 4
April 7, 2023

Hi @ferosekhan ,

 

I'm agree with Saravanan_Dharmaraj.

 

Here Exemple for lastModified property

You can use the below query it have "orderBy and orderby.sort" and it will return the results based on the last modify

 

 

http://localhost:4502/bin/querybuilder.json?type=cq:Page&orderby=@jcr:content/cq:lastModified&orderby.sort=desc]

 

Run the above url, you can change the host & port if you are useing diffrent and After run this you can review the JSON response.

 

Also if you want to test after modification then go to the below path in cxde and change

cq:lastModified property

 

Path: /conf/core-components-examples/settings/wcm/templates/content-page/policies/jcr:content

 

Then re-run your query and review the response you will able to see the updated response based on lastModified

 

Hope that helps!

 

Regards,

Abhi