AEM Query Builder getting property values as json

I got a requirement to list the pages which is having a property and also get the property value. Using query builder we can easily get the nodes having a specific property and there are lot of documentation, blogs which provides that but for retrieving the property value, I was in assumption that we need to write java logic where we can iterate through the nodes and then read property value.

I searched a lot to find whether it can be do-abled using query builder, so that I can avoid writing java logic and finally with lot of research and trial and error I was able to read the property value using query builder.

There might be documentation related to this and I was not able to find it and thought of documenting it.

Ex:

Run the below query using https://<host>:<port>/libs/cq/search/content/querydebug.html

path:/content/we-retail/language-masters
1_property=jcr:title
1_property.operation : exists
p.hits=selective
p.nodedepth
p.properties=jcr:path jcr:title
p.limit=-1

Using p.properties we can list the properties which we need in json format.

Once we get the results, click on "JSON QueryBuilder Link" on the left bottom (highlighted in below screenshot) and results will be displayed in json format





You can use online tool (Ex: https://json-csv.com/) to convert the json to csv, excel based on your requirement.



Comments

Popular posts from this blog

AEM integration with Akamai Fast Purge API for Single/multiple urls

AEM Results count using query builder

AEM - Rollout a page programmatically and update references