How to use "AND" operator in ServiceNow UI page using Javascript?

Aru_
Kilo Explorer

I tried "&&" symbol its not working. Someone suggest me which symbol comes in the place of AND in below code:

 

If(Condition1==true AND Condition2==true)

{

}

 

7 REPLIES 7

manali harmalka
Kilo Guru

Hi Aru,

Try this "^" operator instead of keyword AND

this is equivalent query operator for AND condition.

 

Mark as Helpful or correct if you got your solution.

Regards,

Manali H.

 

nayanawadhiya1
Kilo Sage

Hello,

 

If you are using in HTML Section then you have to use Jelly Scripting.

Use like this -

<g:evaluate var="jvar_gr" object="true">
  var gr = new GlideRecord("incident");
  gr.addQuery("active", "true");
  gr.query();
  gr; // this is the variable put into the variable jvar_gr
</g:evaluate>

And if you are using in Client Script then it will work.

Refr this -

Jelly Tags

Aru_
Kilo Explorer

Hi manali,

I tried this "^" operator also. But it doesn't works me properly. While using this "^" operator the condition doesn't satisfy at any point of the time even the condition is correct. 

 

Regards,

Arun L.

Hi,

Can You try  ${AND} this in place of AND keyword?

refer below link:

https://community.servicenow.com/community?id=community_question&sys_id=17ad836ddb9cdbc01dcaf3231f96...

Regards,

Manali H.