Jelly - how to use "Not Equal" (!=)

jamesmcwhinney
Giga Guru

Help!

Anyone know how to do a not equal to in a situation like this?

Thanks!

- James

Code

<j:if test="${jvar_sc_request.approval != 'requested'}">

              <g:inline template="item_workflow.xml" />

            </j:if>

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi James,



Your syntax is correct and you should be able to use a != in that jelly. I would make sure that jvar_sc_request is an object and not just a sys_id and that it has an approval property.


View solution in original post

2 REPLIES 2

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi James,



Your syntax is correct and you should be able to use a != in that jelly. I would make sure that jvar_sc_request is an object and not just a sys_id and that it has an approval property.


Thanks Brad, that's exactly what it was.


I was using jvar_sc_request but it didn't exist in that context, at least not in the form I expected.


I changed it to the below and got it working.


Cheers,


- James



<td class="sc_os_stage" colspan="1">


            <j:choose>


                <j:when test="${req.approval == 'requested'}"><img src="SMSE_WaitingForApproval.png" width="20" height="20"/> $[SP] ${gs.getMessage('request_awaiting_approval_by')} ${req_approvers}</j:when>


            <j:otherwise>


              <g:inline template="item_workflow.xml" />


            </j:otherwise>


          </j:choose>


          </td>