
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 06:20 AM
Trying to create a Jelly if condition that will essentially do this:
if ((jvar_calling_UI_Page == 'bcp_DEPT_Author_EDIT') || (jvar_calling_UI_Page == 'bcp_DEPT_FULL_VIEW' && bcpPROCESSES.u_name != ''))
I've come up with this:
<j:if test="(${jvar_calling_UI_Page == 'bcp_DEPT_Author_EDIT'}) || (${jvar_calling_UI_Page == 'bcp_DEPT_FULL_VIEW'} ${AMP}${AMP} ${bcpPROCESSES.u_name != ''})">
But it's not working.
I'm sure I just haven't had enough coffee this morning. Could I get a little assistance with the correct way to form the jelly <j:if> syntax?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 08:43 AM
So I was correct. This works:
Here's a good tip that I bet very few have ever encountered:
You cannot mix a <j:if> test condition with a jvar variable and a glide record field result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 06:27 AM
I'm not as familiar with Jelly as I'd like, but I think you need either $[AMP]$[AMP] (with brackets, not braces), or better yet, ${AND}, as your operator.
http://wiki.servicenow.com/index.php?title=Extensions_to_Jelly_Syntax#Ampersand
Hope this helps,
--Dennis R

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 06:36 AM
Your link led me to this: Extensions to Jelly Syntax - ServiceNow Wiki :
So:
<j:if test="${jvar_calling_UI_Page == 'bcp_DEPT_Author_EDIT' || (jvar_calling_UI_Page == 'bcp_DEPT_FULL_VIEW' && bcpPROCESSES.u_name != '')}">
works, but it's always evaluating to true... so now onto why it's doing that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 07:00 AM
Can you try using [] instead of {}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 07:24 AM
This is failing:
<j:if test="${jvar_calling_UI_Page == 'bcp_DEPT_FULL_VIEW' && bcpPROCESSES.u_name != ''}">
This is failing:
<j:if test="$[jvar_calling_UI_Page == 'bcp_DEPT_FULL_VIEW' && bcpPROCESSES.u_name != '']">
Anytime I try and use && it pukes.