Expand my Community achievements bar.

SOLVED

How to orderby/sorting query builder result using node's property?

Avatar

Level 2
 
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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/quer... - Documentation

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

@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/quer... - Documentation

Avatar

Level 4

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&orderb...

 

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

 

Screenshot 2023-04-07 at 4.28.00 PM.png

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

 

Screenshot 2023-04-07 at 4.29.18 PM.png

Hope that helps!

 

Regards,

Abhi