AEM Query for property with no value | Community
Skip to main content
Shubham_borole
Community Advisor
Community Advisor
June 9, 2017
Solved

AEM Query for property with no value

  • June 9, 2017
  • 11 replies
  • 19588 views

I am looking for writing an AEM query using the Query Builder Debugger. My goal is to look for nodes with property "sectionEmail" and value as blank () No Value. I tried something like this below

path=/content/myproject

type=cq:Page

property=sectionEmail

property.value=

As a result I just get all the nodes with the property "sectionEmail" regardless of whther it has a value or not.

Any idea on corrections needed to make on this?

Thanks

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 VeenaVikraman

The solution I was suggesting is to get all the nodes with the property=sectionEmail  and then once you have those , iterate over the property nodes and look for the nodes which has empty value .

Thanks

Veena

11 replies

AnkurAhlawat-1
Level 6
September 13, 2017

Hi snbaem,

Sorry i know i am late, but this might help other folks, Yes we can achieve it through our tool itself. Their is no predicate for checking empty value, but we can achieve the same by using xpath queries. Like below:-

/jcr:root/content/dam//*[fn:name() = 'jcr:content' and @name= ""]

fn:name is optional, added to make query more restrictive.

/jcr:root/content/dam//*[@name= ""]

You can see detail information about it and how to use it here http://www.aemcq5tutorials.com/tutorials/adobe-aem-cq5-tutorials/aem-query-builder/