Jelly “and” condition

August 17, 2015

Tags: ServiceNow Jelly

We’ve all been through the pain of finding how to properly escape and conditions in UI Macros and UI Pages in ServiceNow.

The convention is to escape ampersands like this:

<j:if test="${sysparm_some_var == ''foo'' &amp;&amp; sysparm_another_var == ''bar''}">
<h1>Foo bar</h1>
</j:if>

However you can just use the and keyword to achieve the same thing:

<j:if test="${sysparm_some_var == ''foo'' and sysparm_another_var == ''bar''}">
<h1>Foo bar</h1>
</j:if>

Comments

comments powered by Disqus