< id="DesktopView">

servicenow client script interview questions

What is a Client Script, and what are the different types of Client Scripts?

A Client Script is a JavaScript code that runs on the client-side, typically in a user's web browser. It is triggered by specific client-side events, such as when a form is loaded, when a form is submitted, or when a field value is changed. Client Scripts allow you to enhance user interactions by executing custom logic in response to these events.

There are four main types of Client Scripts:

1. OnLoad: Executes when the form is loaded in the browser. It is commonly used to set default values, modify the form layout, or hide/show fields.

2. OnSubmit: Runs when the form is submitted. It is used to validate form data or perform additional actions before the form is saved.

3. OnCellEdit: Triggers when a cell in a record is edited (typically in list-type forms). It allows you to perform actions based on the changes made to the data in the cell.

4. OnChange: Activates when the value of a field changes. This script is useful for dynamically updating other fields, performing validation, or applying conditional logic based on the new value.

Can we execute an OnChange Client Script during form load? If so, how?

Yes, an OnChange Client Script is always triggered during form load. However, the script often includes a condition that prevents further execution of script if the form is in "loading" state. This is typically controlled by a variable like isLoading, which indicates whether the form is in the process of loading.

To execute the OnChange script during form load, you can modify the script to remove or adjust this check. Here's how you can achieve this:
1. Locate the condition that checks if the form is loading that is condition with isLoading variable.
2. Remove or modify this condition so that the OnChange logic is triggered regardless of the form's loading state.

Sample client script for reference:

How can you allow a user to update the incident state but restrict them from closing it in the list view? OR explain the OnCellEdit Client Script with a real-time use case.

The OnCellEdit Client Script runs when a user updates a record directly from a list view. This script allows you to implement custom logic to validate or restrict certain actions based on user input before the record is updated.

Example Use Case:

In this scenario, we want to allow the user to update the incident state but prevent them from closing the incident directly through the list view (i.e., preventing the state from being set to "Closed").

Below is an example client script which checks if new state value is closed, if yes then don't update the record by sending 'false' parameter to callback function which prevents record update else send 'true' to callback function which will update the record.

Solution

You can create an OnCellEdit Client Script on state field that checks if the new state value is "Closed." If the user tries to close the incident by changing the state to "Closed," the script will block the update. If the new state is anything other than "Closed," the record update will proceed as normal.
                          
function onCellEdit(tableName, record, columnName, oldValue, newValue, callback) {
    if (newValue === 'Closed') {
        // Prevent update if the state is being set to "Closed"
        callback(false);  // Pass 'false' to prevent update
    } else {
        // Allow update if the state is not being set to "Closed"
        callback(true);  // Pass 'true' to allow update
    }
}

                          
                        

Explaination

The script checks whether the new value is "Closed." If the state is being set to "Closed," the callback(false) prevents the record from being updated. If the state is not being set to "Closed," the callback(true) allows the record update to proceed.

What are the different ways to access server-side data in a Client Script?

There are several ways to access server-side data within a Client Script in ServiceNow. The most commonly used methods are:

1. Using the getReference() method:

This method is used to retrieve related record data from the server. It allows you to fetch reference field data asynchronously in a Client Script. For example, if you have a reference field in a form, you can use getReference() to fetch additional data related to that reference field.

2. Using GlideAjax:

GlideAjax is a powerful way to call Script Includes from a Client Script. It allows you to send data to the server and retrieve the result asynchronously. This method is useful when you need to perform complex server-side logic or access large sets of data that cannot be efficiently handled directly on the client-side.

3. Using display Business Rule (BR):

A Display Business Rule can be used to execute server-side logic and return data to the client-side when a form is loaded. This is useful when you want to perform server-side actions, such as data population or validations, during form load phase.

Note:

While it is technically possible to use the GlideRecord API directly in Client Scripts to query server-side data, this is not recommended by ServiceNow. Using GlideRecord in Client Scripts can impact performance and may lead to issues with health scan reports, as it bypasses the platform's recommended data access patterns for client-side scripts.

In summary, for accessing server-side data, the best practice is to use getReference(), GlideAjax, or a Display Business Rule, as these methods are optimized for client-server communication and adhere to ServiceNow's best practices.

What is the order of execution between UI Policies and Client Scripts?

UI Policies execute after Client Scripts. This means that if both a Client Script and a UI Policy are triggered by the same action, the Client Script will run first, followed by the UI Policy.

If there is conflicting logic between a Client Script and a UI Policy, the logic defined in the UI Policy takes precedence and is applied. In cases where both are used to manipulate the same field or form behavior, it's important to carefully plan the logic to avoid conflicts and ensure the desired outcome.

What are the different ways to make field mandatory?

In ServiceNow, there are several ways to make a field mandatory, each with its own use case:

1. Client Script

You can use a Client Script (specifically, an onChange or onSubmit Client Script) to dynamically set a field as mandatory based on certain conditions. This allows for client-side validation and flexibility in how and when the field becomes mandatory.

2. UI Policy

UI Policies can be used to make fields mandatory based on form interactions or conditions. UI Policies are easier to manage than Client Scripts for simple use cases and automatically update the form when conditions are met.

3.Data Policy

Data Policies are similar to UI Policies but are designed to enforce field rules at both the client and server levels. These are particularly useful for ensuring data consistency across records, regardless of how the data is being submitted (e.g., via the UI, API, or import sets).

4.Field Dictionary Level

You can set a field as mandatory at the dictionary level, which ensures that the field is always required whenever a record is created or updated, regardless of the context in which it is used. This is a permanent, system-wide setting for the field.

Each of these methods can be used independently or together, depending on your requirements for field validation and business logic.

What is the purpose of the "Isolate Script" checkbox in Client Scripts?

The "Isolate Script" checkbox in Client Scripts controls whether the script can interact with the Document Object Model (DOM) of the page. When this checkbox is checked, the script is isolated, meaning that it cannot manipulate or interact with the HTML elements of the page (e.g., showing alerts, accessing elements with document.getElementById, or modifying page content).

If you want the Client Script to perform DOM manipulation, you should uncheck this checkbox. This allows the script to execute JavaScript that interacts with HTML elements, such as displaying alerts or modifying page elements dynamically.

DOM Manipulation Code Example

                        
alert("Test message");  
document.getElementById("elementId").style.color = "red";
                        
                      

Note:

DOM manipulation refers to any JavaScript code that interacts with HTML elements on the page, such as changing styles, displaying popups, or accessing form fields directly. However, DOM manipulation is generally not recommended as a best practice in ServiceNow Client Scripts. It can lead to performance issues, inconsistencies across browsers, and challenges with maintainability.

How to access dot walked field value in Client Script?

There are few fields which are not part of current table, they are brought from another reference field table.

e.g. In below example, highlighted field is Caller Email which is brought from Caller reference that is from USER table.

So, to access value from such field, we can use below syntax in client script:
g_form.getValue("caller_id.email");

Which all client script gets executed when we change field value via a list view?

When a field value is changed via a list view, only the OnCellEdit Client Script is executed. This script specifically handles updates made directly in list views (e.g., editing a field in a record displayed in a list).

You might expect that OnChange or OnSubmit Client Scripts would also execute when a field is updated, as they typically run when a field value is changed or a form is submitted. However, OnChange and OnSubmit Client Scripts are designed to run on forms, not in list views. Therefore, they do not execute when a field is updated in a list view.

When should we use a Client Script versus a UI Policy?

UI Policies are ideal for scenarios where you need to make fields mandatory, read-only, or conditionally hide/show fields based on certain conditions. They offer an easy way to enforce field behaviors without writing complex scripts.

Client Scripts, on the other hand, are more versatile and allow you to write advanced scripting logic. They are suitable for tasks like dynamically setting form field values based on complex conditions, retrieving server-side data on the client-side, or performing other custom client-side processing.

What is the g_form object in ServiceNow, and can you provide five common methods of the g_form object along with their usage?

The g_form object is part of the GlideForm client-side API in ServiceNow. It provides various methods to interact with form fields and manage the form's behavior dynamically. You can use it to manipulate field values, display messages, control field visibility, and more.

Here are five common methods of the g_form object and their usage:

1. g_form.setValue(fieldName, value)

Sets the specified field's value to the given value.
Usage: To programmatically set a field value on the form.
Example: g_form.setValue('priority', 2);

2. getValue(fieldName)

Retrieves the current value of a specified field.
Usage: To get the value of a field on the form. Example: var priorityValue = g_form.getValue('priority');

3. g_form.addInfoMessage(message)

Displays an informational message at the top of the form.
Usage: To show a non-intrusive informational message to the user. Example: g_form.addInfoMessage('Your changes have been saved successfully.');

4. g_form.showFieldMsg(fieldName, message, type)

Displays a message on a specific field. The message can be informational, error, or warning. Usage: To display a message next to a specific field, often used for validation or instructional messages. Example: g_form.showFieldMsg('short_description', 'Please enter a valid description.', 'error');

5. g_form.addOption(fieldName, choiceValue, choiceLabel)

Adds a new option to a choice list field. Usage: To dynamically add a new option to a choice field (e.g., drop-down menu). Example: g_form.addOption('category', 'new_option', 'New Category');

How can we prevent form submission using client script?

We can prevent form submission by using the "return false" statement in an "onSubmit" client script. This method is typically used to validate the form before allowing submission.

Here is an example client script:
              
function onSubmit() {
    // Custom validation logic
    if (g_form.getValue('some_field') == '') {
        alert('Some field must be filled!');
        return false; // Prevent form submission
    }
    // If validation passes, the form will submit normally
    return true;
}

              
            

How to execute a client script for a specific view? What does the 'Global' checkbox mean in a Client Script?

By default, the 'Global' checkbox is checked when creating a new client script in ServiceNow. This means the script will run for all views of the form. However, if we want the client script to run only for a specific view, we can uncheck the 'Global' checkbox.

When we uncheck the 'Global' checkbox, a new field labeled 'View' becomes available. In this field, we can specify the name of the view for which we want the client script to execute. This allows us to tailor the behavior of the script for different views, ensuring that the script runs only when needed.

Which all objects we can access in client script?

In client scripts, we can access the following key objects to interact with the form and user data:

1. g_form: This object is used to interact with form fields, retrieve or set field values, manipulate field visibility, read-only status, and other form-related properties.
e.g. g_form.setValue('field_name', 'new_value');

2. g_scratchpad: This object is used to store temporary data on the client side that can be passed from server-side scripts (like Business Rules or Script Includes) to the client-side. It is useful for sharing data between server and client without modifying the form fields.
e.g. g_scratchpad.someData = 'value from server-side script';

3. g_user: This object provides information about the currently logged-in user, such as their username, roles, and other user-related data. It's helpful for conditionally controlling the behavior of client scripts based on the user's identity or role.
e.g. var currentUser= g_user.getUsername();

Real Time Sample Questions:

1. Explain any complex client script that you have created for given requirement?

2. Did you learn anything interesting while working on client script which is not common or documented?

3. Did you ever face any issue/challenges while using GlideAjax call in client script?

4. If you used GlideAjax method to get server side data then why used GlideAjax, why not getReference or Display BR?

Assignment for you:

1. How to send more than one variable from server side script to client side while using GlideAjax?

2. Why we won't be able to stop form submission while validating form data via GlideAjax call?

3. Explain each step that needs to be done on script include side to use it for GlideAjax?


Prepared and confident for your interview? Practice makes perfect! Test your skills with our virtual interview practice buddy and ensure you're fully ready for your upcoming interview. Click here to start.

Fuel My Passion

Loving the content? Well, of course you are. Here’s your chance to indirectly fuel the chaos that keeps this website running. Your contribution helps keep the wheels turning and allows me to continue pretending to be a responsible adult—while cranking out more content for you. Thanks for supporting my delusional dreams and helping me keep this website alive!


Buy Me a Coffee

Support with UPI

If you prefer making a UPI payment to support the website maintenance cost, scan the QR code below:

UPI QR Code

User Added Interview Question and Answers

Sumit Bhandarkar 2025-01-27 08:55:37

What is interceptor page in Servicenow? What are the uses of it?


Mettela Trivendra 2025-03-01 04:20:21
An Interceptor Page in ServiceNow is used in the Service Portal to intercept and control the flow of requests before a user accesses a page. It allows for custom logic, such as restricting access, redirecting users, validating inputs, or applying conditions based on roles or permissions. Key uses include access control, redirection, error handling, data validation, and tracking user actions.
1 Helpfuls
1 Helpfuls


hrdk 2024-12-11 06:46:14

Difference b/w setVisible() and setDisplay()? - they both with hide or show the field but setDisplay will hide and reclame the space while setVisible will simply just hide that field.

0 Helpfuls


abhishek 2024-11-14 06:24:24

can anyone explain Rest API PUT method ? i want to modify every incident in source instance that's need to be reflected in target instance. for each record we can give sys_id of the record what about all records ?

0 Helpfuls


raja 2024-08-18 04:40:15

Please add the questions related to HRSD and CSM As well .

0 Helpfuls


Neetha 2024-08-18 04:18:08

Can someone please the examples of client scripts. Like real time requirements where client scripts are created

0 Helpfuls


Priyanka 2024-07-31 06:37:42

Why g_form object will not work in onCellEdit Client Script?


Omkar Mane 2024-08-03 22:51:36
The g_form object doesn't work in onCellEdit client script because onCellEdit is used for list views, not forms. g_form is specific to form contexts. In onCellEdit use object like g_list to interact with the list.
0 Helpfuls
0 Helpfuls


Akshay Kumar 2024-07-27 09:10:30

Guys, In my Interview They asked like What complex Scenario you have worked on, how you have troubleshoted and if it not solved by you then by whom you get help ? Please answer

0 Helpfuls


Keerthana Arumugam 2024-05-21 07:48:24

What is eval function in client script

0 Helpfuls


Suresh , K 2024-03-21 09:00:35

Let us consider there is checkbox field with 3 values. out of 3 checkbox field user should select atleast 2 checkbox. incase, if user did not selected 2 checkbox then error should display


Pradeep 2024-04-02 08:45:30
You can create onSubmit client script and write below script in it : var check1 = g_form.getValue('checkbox1'); var check2 = g_form.getValue('checkbox2'); var check3 = g_form.getValue('checkbox3'); var checkArray = [check1, check2, check3]; var count = 0; for (var i = 0; i < checkArray.length; i ) { if (checkArray[i] == true) { count ; } } if (count < 2) { g_form.addErrorMessage('Please check atleast 2 checkboxes'); return false; }
0 Helpfuls
snowexpertaastik 2024-11-02 03:58:10
function onSubmit() { var checkOne = g_form.getValue('u_one'); var checkTwo = g_form.getValue('u_two'); var checkThree = g_form.getValue('u_three'); var arrTrue = []; var checkBoxArr = [checkOne, checkTwo, checkThree]; for (var i = 0; i < checkBoxArr.length - 1; i ) if (checkBoxArr[i] == 'true') { arrTrue.push(checkBoxArr[i].toString()); } if (arrTrue.length >= 2) { g_form.addInfoMessage('Thank you for choosing atleast two check boxes '); } else { g_form.addErrorMessage('Atleast you need to sewlect three check boxes and as you have not sel;ected it you are not able to save it '); return false; } }
0 Helpfuls
0 Helpfuls


Sudheer 2024-03-03 23:00:33

I was asked what is the difference between getXML() and getXMLAnswer()?


Srinithi 2024-03-09 19:15:04
getXML() gives the entire XML document but getXMLAnswer() only retrieves the far more efficient Answer.
2 Helpfuls
0 Helpfuls


saini 2024-02-28 08:47:03

Complex example of client script, or the most complex client script you wrote, this interview question is asked in almost all the interviews?


SM 2024-04-27 07:11:26
Can anyone share a sample answer for this
0 Helpfuls
Varun 2024-05-28 04:21:13
There is no specific answer to this. However, client script with single/multiple GlideAjax call could be considered as complex one as it requires both server side and client side scripting. So, if you have written any such client script then you can mention it.
0 Helpfuls
2 Helpfuls


Devarsh 2024-02-12 06:04:37

What will happen if we use GlideRecord in client script?


Anshika 2024-04-24 12:08:09
It works fine. However, Client-side GlideRecord is massively inefficient, far too slow, and returns way too much unnecessary data.
0 Helpfuls
Radha 2024-10-31 04:52:06
Yes, it works fine. However, it acts as synchronous call which blocks session until required data is received from server. It is considered as bad user experience so it is always better to use Asynchronous call in client script e.g. GlideAjax, getReference method with callback function etc. We can also use GlideRecord with callback function but this is method is underrated and rarely used.
0 Helpfuls
0 Helpfuls


Rohit 2023-09-20 11:39:25

The interviewer asked if we need Email in the email field when user field is filled it automatically populated in the INC form. So, I said we can achieve by the client script we use getrefrence field (Sys_ID) he needs more info so please answer it


Laxmi 2023-10-26 19:29:20
Ypu can use below script: function onChange(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading || newValue === '') { return; } //if(newValue != ''){ var caller = g_form.getReference('caller_id'); g_form.setValue('u_email', caller.email); //} }
0 Helpfuls
Pratiksha Langde 2023-10-27 10:24:51
getReference is not the best practice to get data from server side to client side. we should be using GlideAjax to fetch data from server side to client side. if you want to use getReference then you can use this code using on change client script : unction onChange(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading || newValue === '') { return; } //Type appropriate comment here, and begin script below var user = g_form.getreference('requested_for', function(user) {// map the correct field g_form.setValue('u_email', user.email.toString());// map the correct field }); } if you want to auto-populate the email id based on logged-in user the please line in the default value of the email id field : javascript: gs.getuser().getRecord().getValue('email); Using GlideAjax : Create a new client callable script include with following function var UserDetails = Class.create(); UserDetails.prototype = Object.extendsObject(global.AbstractAjaxProcessor, { getUserInfo: function() { var details = {}; var userId = this.getParameter('sysparm_user_id'); var userObj = new GlideRecord('sys_user'); userObj.addQuery('sys_id', userId); userObj.query(); if (userObj.next()) { details.email= userObj.email_id.toString(); } return JSON.stringify(details); }, type: 'UserDetails' }); Create a new catalog client script on the record producer/request form function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } var ajax = new GlideAjax('UserDetails'); ajax.addParam('sysparm_name', 'getUserInfo'); ajax.addParam('sysparm_user_id', g_form.getValue('employee_name')); // change variable name here ajax.getXML(doSomething); function doSomething(response) { var answer = response.responseXML.documentElement.getAttribute("answer"); var answers = JSON.parse(answer); g_form.setValue('var_email_id', answers.email.toString()); // change variable name here } }
2 Helpfuls
Rohit 2023-11-16 05:27:34
Do we need an additional field of 'Email' to auto-populate the email address of user?
0 Helpfuls
Tanya 2023-11-28 05:19:31
no
0 Helpfuls
Soumaya 2023-11-28 11:41:35
If you would like to show email address of user on incident form then we can dot walk to user reference field and bring email field on task form. This way, we don't need to write any script to populate email address when user is changed.
1 Helpfuls
0 Helpfuls


Mujahid 2023-09-01 01:51:33

interviewer asked me , what are the backend tables, i said incident l, probelm, but he said no. let me know what are the backend tables.


Kapil 2023-09-19 22:16:51
The interviewer is asking about the backend name of the tables. for example, Incident table is incident, change table is change_request,
0 Helpfuls
Feroz Khasim 2023-12-05 20:18:43
For all the tables we have one table that is stored in database and the table name is "sys_db_object.LIST"
1 Helpfuls
0 Helpfuls


Balaji 2023-08-25 02:19:29

When we will use client script and script include with glide Ajax.Please can you explane with one use case


Atul 2023-09-26 11:37:56
Whenever you need data in client script which is not available on the form then you will need to get it from server database. And to do so we can use GlideAjax. OR if you need to perform any operation/validation which requires server side script then we need to use GlideAjax.
0 Helpfuls
0 Helpfuls


Mujahid 2023-08-10 19:21:28

4. If you used GlideAjax method to get server side data then why used GlideAjax, why not getReference or Display BR?


Saritha 2023-08-29 12:48:11
g_scratchpad is sent once when a form is loaded (information is pushed from the server to the client), whereas GlideAjax is dynamically triggered when the client requests information from the server. If you're using getReference you will get ALL data for each record you "get" whether you need it or not.
0 Helpfuls
0 Helpfuls


Sammy 2023-07-27 09:42:42

How to update change state from "Scheduled" to "Implement" automatically when Planned start date is reached?


Suresh Thorati 2023-09-26 07:14:18
1. Create a BR on Change Table. a. State = Scheduled Advanced: use glide time
0 Helpfuls
Trupti 2023-10-09 11:15:32
- You can either use Flow Designer or Scheduled Job. - Schedule it to execute daily. - Glide into 'Change' table and check if planned start date = todays date and state=scheduled then update change state to 'implement'
0 Helpfuls
snowexpertaastik 2024-11-02 04:36:14
Basically you can write one Scheduled job that runs daily and check those whose Planned Start date is today and if records matches conditions then update the state of those records to implement . Below is the sample code var changeReqs = new GlideRecord('change_request'); changeReqs.addEncodedQuery('start_dateONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()'); changeReqs.query(); while(changeReqs.next()){ changeReqs.setValue('state',-1); changeReqs.update(); }
0 Helpfuls
0 Helpfuls


Madhuri 2023-06-29 10:52:21

tell me some limitations and considerations when using client scripts in ServiceNow.


Uday 2024-01-17 11:54:08
We can use DOM manipulation.
0 Helpfuls
0 Helpfuls


Madhuri 2023-06-29 10:44:35

Can you describe a scenario where you used a client script to enhance the user experience in ServiceNow? What was the problem you were trying to solve, and how did the client script address it?

0 Helpfuls


Madhuri 2023-06-29 10:44:00

What is the difference between synchronous and asynchronous client scripts? When would you use each type?


Kevin 2023-07-11 07:51:56
There is not exact concept called Synchronous/Asynchronous client script. However, if you use GlideAjax (which makes async call) in client script to get data then you can say it is Asynchronous client script. And client scripts that do not use GlideAjax, you could say those are synchronous.
0 Helpfuls
0 Helpfuls


Madhuri 2023-06-29 10:43:31

How do you debug client scripts in ServiceNow? Can you explain the techniques or tools you would use?


Tirupati 2023-08-03 22:09:48
We can debug Client script by keeping alerts var cat = g_form.getValue('catgory'); alert(cat); ..... .....
0 Helpfuls
0 Helpfuls


Manasa 2023-06-29 10:40:13

If we are making the field read only with client script , can ITIL user can edit from list view ?


Rakhi 2023-07-11 07:40:14
Yes, they can. We generally make fields read only via onLoad/onChage client script and it works only for form view not for list view.
2 Helpfuls
0 Helpfuls


Manasa 2023-06-29 10:39:25

Can you call a business rule through a client script?


Imraan 2023-07-11 07:46:21
You cannot call BR from client script. However, you can write Display BR to store values in g_scratchpad object and access that object in client script. Practically there is no any scenario where you would need this. If you want any server side data in client script then you can always use GlideAjax in client script.
0 Helpfuls
0 Helpfuls


Manasa 2023-06-29 10:37:48

What are the features you like and don't like in client scripts? What do you think would make it even better if X were given in a certain way?

0 Helpfuls


Kanika 2023-06-14 03:19:42

A group have only one member and I want to send the approval to it's dedicated member and if he does't exists,then send aproval to manager's manager How should I achive this through flow designer or BR


Pratik 2023-06-21 07:14:48
Hello Kanika, This can be implemented easily via workflow where you can inlcude validation script to check if dedicated user exist in that group, if not, then send it to managers manger. Workflow allows us to write such quite complex logic while triggering approval. However, I am pretty sure it can be achieved via Flow Designer as well but it becomes quite difficult to implement such logic in flow designer. I would not recommend to BR for triggering approvals as it becomes difficult to track approval status to perform further operation.
0 Helpfuls
1 Helpfuls


Sahitya 2023-06-08 06:29:57

I was asked what is difference between Client scripts and Catalog Client Scripts.. can anyone please post the answer for it


Martin 2023-06-09 03:37:34
Hi Sahitya, As such there is no difference technically. However, Catalog client scripts are written for catalog items or variables sets and Client Scripts are written for backend tables e.g. incident, problem etc.
0 Helpfuls
Surendra 2023-07-13 04:00:32
As Such there is no difference technically. Client script have 4 types Onload OnChange OnSubmit Oncelledit Catalog client script have 3 types Onload Onchange Onsubmit
0 Helpfuls
Satyapriya Biswal 2023-07-13 18:32:25
Catalog client scripts stored in catalog_script_client table and Client scripts stored in sys_script_client table. In catalog client script we have the option to apply the client script to the catalog item view, RITM view , Task view and also Target record view But in Client script we does not have that options. In Client script we can apply the script to a specific view by checking the Global checkbox But in catalog Client script there is no Global check box because Catalog client script applies on a specific catalog item or a variable set
3 Helpfuls
Anonymous 2023-08-01 21:37:15
in catalog client script their is no cell edit type client script we have only 3 types i.e onload, on submitte, on change that is major diffrence in that
1 Helpfuls
2 Helpfuls


Amit 2023-05-05 22:05:42

How we can achieve this scenario If approval is triggered to requester's manager and if he does not approve for 3 days then it should pass to manager's manager


Rahul 2023-05-22 01:57:17
We can achieve this via workflow. While triggering approval to requester's manager, parallelly we can trigger timer activity for 3 days, preceded by approval to requester's manager manager. If requester's manager approves within 3 days then end the workflow. If requester manager doesn't approve within 3 days then timer activity will complete and then another approval to requester's manager manager will trigger.
1 Helpfuls
Kanika 2023-06-14 03:11:50
If approval is triggered to requester's manager and if he does not approve for 3 days then it should pass to manager's manager I need to do it using flow designer, then how can this be achived?
0 Helpfuls
Gagandeep 2023-10-11 23:31:46
Hi, We can achieve the above task by using flow designer by using approval action in it and setting the Wait For Condition of 3 days for Manager to approve it and then in case of not approved it will be assigned to Manger's Manager
0 Helpfuls
0 Helpfuls


Riya 2023-03-29 05:51:21

I was asked, what is the difference between setDisplay and setVisible method. I said, setVisible maintains space even if field is hidden and with setDisplay, we won't have space in between the hidden fields. But Interviewer asked me to explain it in more technical way, can somebody please help me to understand how this could be answered in more technical way?


Anubhav 2023-03-29 06:30:36
Sometimes, interviewer expects deeper understanding from candidates if candidate is having more experience. May be you could have explained how these things work in backend at DOM level. e.g. We have equivalent concept in CSS, if we use visibility:hidden in CSS to hide fields, it causes their space to be retained. But, on the other hand, if we use display:none, it causes space to be removed. So, I believe this is what ServiceNow uses in backend. This answer could have impressed interviewer.
2 Helpfuls
Riya 2023-03-30 05:17:07
I never knew this, it's really impressive answer. Thank you.
0 Helpfuls
0 Helpfuls


vardha 2023-03-29 04:52:54

what are assignment rules?


Mohit Singhal 2023-04-01 05:36:44
This module appears under the ‘System Policy application’ menu. It helps to automatically assign the tasks to a particular user or a particular group using the assigned_to and assignment_group fields respectively, depending on the specified set of conditions. One can define these assignment rules readily for their desired table.
0 Helpfuls
Kumar 2023-08-15 22:22:52
Any examples?
0 Helpfuls
Sandeep 2023-08-24 06:18:57
let's say we select category as 'Hardware' and subcategory as 'Mobile' based on these selections we can make 'assignment group' and 'assigned to' fields automatically display.
0 Helpfuls
Nikhil Kamlekar 2024-04-01 14:30:32
Assignment Rules: In HRSD, i have used this I gave condition like if hr service is benefits inquiry and assigned to empty then you can assign to particular group.
0 Helpfuls
SEETHA LAKSHMI PRIAPPAN 2025-01-03 23:18:49
Assignment rules in ServiceNow automatically set values in the assigned_to and assignment_group fields when certain conditions are met .Go to system policy->Assignment data look rules->create new record based on your requirement.
0 Helpfuls
0 Helpfuls






🚀 Power Up Your ServiceNow Career

Join a growing community of smart ServiceNow professionals to stay ahead in interviews, sharpen your development skills, and accelerate your career.

Comments

venu 2024-07-03 23:51:47
thank you team



Babu Chokka 2024-04-10 01:21:14
Very useful portal where we can share and gain the knowledge



saini 2023-11-02 13:19:43
good work



Gunjan 2023-08-23 11:29:39
Thank you for providing such quality content. This is really useful for interview preparation. I would like to give small suggestion, please add upvoting question or answer options so that reader will understand importance of question or answers.



Prashanth 2023-04-13 07:06:55
Thank you so much Team. I have been asked almost all questions from your set. Finally I got offer today so thought to appreciate your work.



anonymous 2023-04-12 00:58:57
Amazing content, almost in all the interviews I get these similar questions.



vardha 2023-03-29 04:54:15
good content . helped me crack level 1 interview easily. keep up the good work!

SN Buddy Team
2024-05-28 06:52:23
Thank you everyone for your valuable feedback, it makes us happy to see that our content is playing such crucial role in your interview preparation.