Start a new topic

Path: How to check if an attribute is empty?

I want to filter a set of Items whether an attribute is empty or not. I Have tried using matches:

@ATTR.Matches('^$') that is supposed to identify empty strings(?). I want to do this both for an enumeration attribute and a string attribute.

How can I do this?

Best Answer
Does not this simple solution work?


Does not this simple solution work?


It does. I thought I tried that yesterday without success. Thanks!

I think this will not work  for example:
ERROR: No '=' operator on (Boolean, String) could be found

But if you add ".ToString" it will work


It depends on the type of the attribute.

In your case Bashar you have a boolean attribute: AREP, while Fredrik possibly had a string attribute.


1 person likes this
Thanks Magnus!


Hello, I have similar question here: is there any way I can check if <List> object is empty? 

Hi Jakub,

You can use .Count which counts the number of object in a list.


<If test="/SID1/SID2.Count=0">



Best regards,


There is a rather elegant, but possibly a bit abstract, example in the Help manual, on the "[ ] Operator":





Returns all report sections without any subsection.

Login to post a comment