How to use "AND" operator in ServiceNow UI page using Javascript?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2018 06:17 AM
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)
{
}
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2018 11:46 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018 12:04 AM
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 -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018 12:07 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018 12:23 AM
Hi,
Can You try ${AND} this in place of AND keyword?
refer below link:
Regards,
Manali H.