interview Flashcards

(238 cards)

1
Q

What is the purpose of Isolate script checkbox in client script?

A

It manages whether DOM manipulation should be enabled/disabled for client script. If DOM manipulation code is not working then there is possibility that this checkbox is true which is forcing client script to run in strict mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

Only on cell edit client script gets executed when we update field via list view. We might think on change or on submit client script should also execute as we are changing field and submitting record to database but these two client script executes on form only.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When we are supposed to use client script and when to use UI policy?

A

UI Policies are recommended to use when we want to make field mandatory,read only or hide/show fields.

Client script can be used to write quite complex scripting. e.g. Setting value on form based on some condition, getting server side data on client side etc.

Note: We can write script in UI policy also but we should be using Client script wherever possible when it comes to writing client side scripting. We are supposed to use UI policy script only when same is not possible via client script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is g_form object? provide 5 methods of g_form object with its usage?

A

The GlideForm client-side API provides methods for managing form and form fields including methods to:

  • Retrieve a field value on a form
  • Hide a field
  • Make a field read-only
  • Write a message on a form or a field
  • Add fields to a choice list
  • Remove fields from a choice list

Below are the common methods of g_form object :
g_form.setValue : sets value in specified field.
g_form.getValue : gets value from specified field.
g_form.addInfoMessage : Display info message on form.
g_form.showFieldMsg : display field message.
g_form.addOption : Add new option in choice field.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to prevent form submission via client script?

A

We can use “return false” statement in on submit client script to prevent form submission.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to execute client script for specific view? or What is ‘Global’ checkbox in Client Script?

A

By default ‘Global’ checkbox is checked while creating new client script. It means client script will execute for all views. When we uncheck it, new field ‘View’ will be visible, we can mention view name here to execute client script for specific view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which all objects we can access in client script?

A

We can access below objects in client script
1. g_form
2. g_scratchpad
3. g_user
4. g_menu
5. g_item
6. g_scratchpad

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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

A

return multiple XML nodes and attributes from the server.

But there is a better alternative: return data using JSON. Doing this way, the data sent from the server is better structured and the script is easier to maintain as it is more comprehensible for the developer. From the server, you would encode the data to a JSON formatted string. From the client, you would retrieve the JSON formatted string and decode it into a javascript object.

Below, the detailed steps in both server and client side scripts :

Server side

  1. Prepare the data you want to send to the client. Data can be contained in a simple object or an array.
  2. Instantiate a JSON object and encode the data to be sent.
  3. Return the data. The data sent to the client is in a JSON formatted string.

var myObj = {};
return JSON.stringify(myObj);

Client side

  1. Retrieve the data
  2. Decode the JSON formatted string into an object or array, which contains multiple values.
  3. Process the values regarding the business requirements.

var myObj = JSON.parse(answer);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

step that needs to be done on script include side to use it for GlideAjax?

A

Create your script include, check client callable.
Create a new client script,
Call your script include with new GlideAjax(script include)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is eval function in client script

A

The EVAL function is used to basically evaluate variables and do “stuff” to it. You’ll mainly use it to create if, then functions to transform certain fields in tables or any other variable you want to manipulate. Improper use of eval() opens up your code for injection attacks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is the difference between getXML() and getXMLAnswer()?

A

getXMLAnswer is slightly easier to write :slightly_smiling_face: and getXML returns a whole XML Document while getXMLAnswer only returns an Answer which is far more efficient.
getXMLAnswer() saves you a line of code every time you use it. That is it. There shouldn’t be any noticeable difference in speed, though this method is probably guaranteed to be slightly slower as it runs at least one more line of code each time. So ease of use vs minuscule difference in speed.

with getXMLAnswer() uou no longer need this line of code.

var comments = response.responseXML.documentElement.getAttribute(“answer”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What will happen if we use GlideRecord in client script?

A

It works fine. However, Client-side GlideRecord is massively inefficient, far too slow, and returns way too much unnecessary data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what are the backend tables

A

For all the tables we have one table that is stored in database and the table name is “sys_db_object.LIST” The backend name of a table in ServiceNow is a unique identifier that is used to reference the table in the database. It is typically a short, alphanumeric string that begins with the prefix “sys_”. The backend name of a table can be found by viewing the table’s properties in the ServiceNow user interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When we will use client script and script include with glide Ajax.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A
  1. Create a BR on Change Table.
    a. State = Scheduled
    Advanced: use glide time
  • 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’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

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

A

e can debug Client script by keeping alerts
var cat = g_form.getValue(‘catgory’);
alert(cat);

The most approached way I have seen that developers follow is using alert() method or console.log() method. This approach is no doubt helpful but, what if you are not sure at which line of code you are having data processing issue? You may end up with multiple alert messages and unknowingly you may end up irritating other people who are working on the form, as those alerts will popup on their screen as well .

Debug mode of browser developer tools in client scripts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Can you call a business rule through a client script?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

what is difference between Client scripts and Catalog Client Scripts.

A

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.

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

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

A

e 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

hat 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,

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What are the different objects accessible in BR?
- Current - Previous - gs - g_scratchpad Note: Previous object is null in Asynch BR, as there could be multiple updates on same record while BR is in queue for execution which might create conflict on which version needs to be considered as previous.
26
What is display BR? When to use it? Explain with real time use case?
Display rules are processed when a user requests a record form. The data is read from the database, display rules are executed, and the form is presented to the user. The primary objective of display rules is to use a shared scratchpad object, g_scratchpad, which is also sent to the client side as part of the form. This can be useful when you need to build client scripts that require server data which is not typically part of the record being displayed. Real time use case : If logged in user is member of current assignment group then only show description field. We can write display BR as shown below to check if logged in user is part of current group or not and store result in g_scratchpad object, which later can be accessed in client script to show/hide description field accordingly.
27
What is query BR? What is primary objective of it? Explain it with real time use case?
Before query business rule gets executed whenever query made to the database on particular table. The primary objective of query BR is to hide/show records, this could be based on conditions. Real time use case : Show only active users to all users who is not having admin or user_admin role. Below BR is OOTB, it checks if user has admin or user_admin role, if yes then it shows all user records else shows only active users.
28
What is the difference between query BR and ACL?
1.Query business rules only apply for read access at the row level while ACLs can do CRUD operation at the row and column level. 2. Query BRs will affect a GlideRecord query result where ACLs will not unless we are using GlideRecordSecure class. 3. Query BR shows only those records where filter criteria matched while ACL shows all pages with the restricted records being invisible and a message at the bottom 'some records removed due to security'.
29
What are global Business Rules?
A global Business Rule is a Business Rule where the selected Table is Global. Any other script can call global Business Rules. Global Business Rules have no condition or table restrictions and load on every page in the system. Note : The reason we would need to use Global Business rules in the past is if we wanted a custom globally accessible function, such as getMyGroups, or getUser. Now a days we can do the same thing in Script Includes which has less performance impacting way.
30
How to prevent form submission via Business Rule?
We can use 'current.setAbortAction(true)' in Business Rule script to abort action. This will stop data updation in database.
31
How to identify if current operation is insert, update or delete in Business Rules?
We can use current.operation() in BR. Depending on current operation, it returns update, delete or insert value.
32
What is the result data if we filter only active records through Query BR and add reference qualifier with active =false condition?
It will show 0 records, since query BR gets executed whenever query made to the table which will return only active records and as reference qualifier is adding active =false filter, system will show 0 records.
33
Which type of BR shouldn't include current.update() and why?
current.update() function not be used in a "query" type Business Rule, it actually cannot be called and will generate an error if called in this type of Business Rule. This is because, at the time this Business Rule is called, upon the initial query of a list or collection of records, there is no concept of a "current" record.
34
What is order of running the rules like which rule runs first business rules ,second Ui policy and so on
Query BR -> Display BR -> On Load CS -> On Load UI Policy -> On Change CS -> UI Policy -> Before BR -> After BR -> Asycnh BR
35
how to call script include in business rules?
var scrptInc=new yourScriptIncludeName(); scrptInc.functionNameOfYourScriptInclude();
36
what is main difference between UI Policy and Client Scripts.
- We can execute client script on submit or on cell edit (list field update) but we cannot execute UI policy on submit or on cell edit. - We can execute client script for specific view but we cannot do the same via UI Policy. - UI Policies are faster as compare to Client scripts, therefore ServiceNow recommends to use UI Policies wherever possible. UI Policies can be run for a specific view if you uncheck the Global field and then enter the view name you need.
37
Whether the g_scarthpad can be used on all the types of client script?
In most of the use cases, we access it in onLoad client script. However g_scratchpad object can be accessed in all type of client scripts. In fact it can be accessed in UI policy script also. Here is very important use case where it can be used in on submit client script, if we want to validate something on submit of the form but data is not available on client side. Normally we use GlideAjax to get server side data but GlideAjax fails in onSubmit client script (GlideAjax is asynchronous call therefore form gets submitted before GlideAjax returns result). Therefore we can store result in g_scratchpad object in onChange client script and based on value we can restrict form submission in on submit client script.
38
How to autoclose REQ and RITM when task is closed.
to achieve this we can write two BR 1-sc_task 2- on table sc_req_item condition-state changes to closed complete logic 1- var rtm = new GlideRecord('sc_req_item'); rtm.addQuery('sys_id', current.request_item);//request_item is a field of sc_task rtm.query(); while (rtm.next()) { rtm.state = '3'; rtm.update(); } logic2-var req = new GlideRecord('sc_request'); req.addQuery('sys_id',current.request); req.query(); if(req.next()){ req.request_state = 'closed_complete'; req.update();
39
when the incident state is closed related problem state should also be closed
e can write After BR as below to achieve this requirement: Table : Incident BR Condition : When state changes to Closed var grProblem=new GlideRecord("problem"); if(grProblem.get(current.problem_id)){ grProblem.setValue("state",3);//3 is closed state back end value grProblem.update(); } Tip : Interviewer later asks why After BR, why not before BR or Asynch BR? short and simple answer is, if we are updating other than current record then we are supposed to use after BR. If script is too lengthy and execution time is high then we can go with Asynch BR (which runs in backend so that user don't have to wait till BR executes)
40
How to trouble shoot if user is not able to login?
There could be different reasons why user is not able to login but most common is wrong password or user doesn't exist in ServiceNow. Therefore, we can troubleshoot issue by following below steps 1. Verify if user exist in ServiceNow User(sys_user) table. 2. Try resetting user password. 3.User is active 4.user id is not empty 5.Most Important - User is not locked out
41
What if we have before query BR which is filtering data to show only active incidents. what will happen if we use the fix script on the incident(via glideRecord) will it show all the records in the present in the incident table if no addQuery is used?
If before query BR is adding filter to show only active incidents and if we try to GlideRecord on incident table then it will return only active incidents. Before query BR executes every time action is performed on database, it doesn't matter if database action is performed via UI or via script.
42
Why current.update() in before BR doesn't create recursion call to same BR infinitely?
System has internal detectors for this and will prevent an endless series of such Business Rule executions, the detection of this has been known to cause performance issues in that instance.
43
What is an ACL?
An access control is a security rule defined to restrict the permissions of a user from viewing and interacting with data. Most security settings are implemented using access controls. All access control list rules specify: 1. The object and operation being secured 2. The permissions required to access the object
44
What are the different type of ACL?
Based on the operation, it is divided into 4 type i.e. Create, Read, Write, Delete. Based on the level, it is divided into 3 type Table level ACL with None Table level ACL with * Wildcard Field level ACL
45
What is the difference between Table.none and Table.* ACL?
- Table.none is a row level ACL which allows you to access records. - Table.* is a field level ACL which gives Access to all field on the table. Below are the scenario's to understand how none and * acl works together : 1. If we define a READ ACL with Table.None for users with role ITIL and ITIL_ADMIN Result : Both ITIL_ADMIN and ITIL users will be able to view all records because they have read access to all records with no field level restrictions. 2. If we define a READ ACL with Table.None for ITIL_ADMIN, ITIL and Table.* for ITIL_ADMIN Result : Only ITIL_ADMIN will have read access because the Table.* is an explicit rule at the field level that grants only ITIL_ADMIN read access to all fields. 3. If you define a READ ACL with Table.None for ITIL_ADMIN and Table.* for ITIL Result : ITIL will not be able to view any records because they only have read access at the field level and not at the Record/Row level.
46
If we have ACL to make field read only and we have UI policy to make it editable, what would be the result?
Field will still be read only. It doesn't matter if UI policy or client script is making it editable, user has to pass ACL rules to gain edit access.
47
Provide all ACL details which are required to achieve below scenario : Users with Role A should have write access to all field except Configuration Item on incident table and Role B should have write access to Configuration Item field and all other fields should be read only?
1. Create new Table.None Read ACL and add both Role A and Role B which will allow both users to get row level read access. 2. Create new Table.None Write ACL and add both Role A and Role B which will allow them to get row level write access. 3. Create new Table.* Write ACL and add Role A only which will allow Role A users to edit all fields on incident table. 4. Create new Table.configuration_item Write ACL and add Role B which will allow only Role B to edit configuration item and it will not provide editable access to Role A users.
48
When we include roles, conditions and script in ACL, is it mandatory to satisfy all condition or only one of it?
Logged in user should satisfy all of three criteria then only ACL will grant access to user.
49
Can we configure ACLs being admin?
No, we need to elevate Security Admin role to configure ACL.
50
What is admin override in ACL?
Admin Override provides access to admin even if they don't satisfy ACL criteria.
51
What are the different ways to make particular field read only?
You set read only by using UI policy, client script(g_form.setReadOnly("fieldName",true) or you can write ACL. Data Policy at the serverside
52
Is there anything above ACL which also can apply security restriction?
Query Business Rule could potentially be used as an alternative to ACLs in your scenario. A Query Business Rule allows you to restrict or modify the data that is returned from a specific table based on defined conditions.
53
Why most of the entities like ACL forces developer to set result in 'answer' variable?
Components of ACLs All-access control list rules specify: The object and operation being secured The permissions required to access the object The object is the target to which access needs to be controlled. Each object consists of a type and name that uniquely identifies a particular table, field, or record. ACL evaluation process An ACL rule only grants a user access to an object if the user meets all of the permissions required by the matching ACL rule. The condition must evaluate to true. The script must evaluate to true or return an answer variable with the value of true. The user must have one of the roles in the required roles list. If the list is empty, this condition evaluates to true. [Record ACL rules only] The matching table-level and field-level ACL rules must both evaluate to true.
54
how to hide few choices from list view
g_form.removeOption(, );
55
The incident should be filtered based on the logged in Users country.
You can create an ACL with a script, in the script you can compare the user's country and incident's country(if there is such field on the incident table), if they come out to be true then answer is true, else its false.
56
For Incident form, There is ACL which is restricting write access for a role and there is another ACL which allows user with same role to write. Which ACL will work, Will the user with that role able to write or not?
Yes, user will be able to write. If user satisfies at least 1 ACL criteria then he will get required access.
57
execution order of Acl in ServiceNow ? and Read ,write, delete, create which one excute first ?
If user don't have READ access then providing WRITE, DELETE or CREATE access doesn't make any sense so I believe, READ ACL should be executing first which will make sure to not evaluate further ACL if user does not pass READ access. Execution order is always : Role >> Condition >> Script
58
What is reverse if false, on Load, inherit and Global option in UI policies?
On Load : Option for specifying that the UI policy behavior should be performed OnLoad as well as when the form changes. Inherit : Option for specifying whether extended tables inherit this UI policy. When a child table has an inherited UI policy from it\'s parent table, the UI policy on the child table always runs first. This event is true regardless of the Order of the UI policies. Global : Option for specifying whether the UI policy applies to all form views. If this check box is cleared, the UI policy is view-specific. Reverse if false : Option for specifying that the UI policy action should be reversed when the conditions of it\'s UI policy evaluate to false. In other words, when the conditions are true, actions are taken and when they change back to false, the actions are reversed (undone).
59
Which one execute first UI Policy script or UI policy action?
UI Policy action executes first then UI Policy script executes. So, if there is conflicting logic between them then UI policy script will take precedence as it executes at last.
60
If client script is making assignment group field read only and UI policy making it editable, what will be output?
Client script executes first and then UI policy, therefore, action taken by UI policy will reflect as output i'e assignment group will be editable.
61
I was asked that UI policy actions and UI policy Script Which runs first in the UI policy?
Ui Ploicy Action will run first and then UI Ploicy Script will run, if there is a conflicting logic, then UI Policy Script will take precedence anyways because it is the last one executing
62
Explain one of the UI policy that you have created? Why used UI policy, why not Client script or ACL(if you are making field read only)? Was there any other way to achieve the same requirement?
My thoughts on the above question would be: If we want to perform different operation a single filed using a UI Policy it would be difficult, as UI policies do not allow more than one operation on a specific field. Say there is a scenario where if certain conditions are met, then I make the field mandatory or visible, and when they do not match I would make it non mandatory or hide using reverse if False. Now say I have another situation which is not exactly same as per my conditions on the UI policy also not completely contraditing and I would only want to make the field mandatory and no actions for visibility, I will not be able to achieve this via UI policy and would need to use a client script, since UI policies will not permit multiple conditions to run on the same field. There are no actions that can be achieved via UI Policy and not via client scripts, but we ight have to make our selections based on the requirement. UI policy are no code to low code client executions which reduces load time and easy to use, but if we have a dependency on the previous object value or involves more logic we will have to go with client scripts. The only case I can think of the reason where we cannot use an ACL and need to use a UI policy or client script is when we are applying restrictions on catalog forms.
63
when you will decide to use UI policy and data policy I told Ui policy will be used to make changes in client side form and data policy in server side. Interviewer expecting more from me.
You are right, Ui Policy is client side and Data Policy is server side validation. But better and clear answer would be. If we would like to apply the validations for the data that is entered by user manually on forms then we will use UI Policy. On the other hand, if we would like to apply validations for the data which is coming via Integration (or not entered manually by end users) then we will use Data Policy.
64
what are the pre requisites to convert Ui policy to Data policy?
For a UI policy to be eligible for conversion to a data policy, the following conditions must be met on the UI Policy form. - The Run scripts check box must be cleared. - The Global check box must be selected. - None of the UI policy actions can have Visible set to True or set to False. Visible must be set to Leave Alone.
65
What is UI action?
UI actions include the buttons, links, and context menu items on forms and lists. Configure UI actions to make the UI more interactive, customized, and specific to user activities.
66
How to override UI Actions for an extended table?
There are two ways to override UI action: 1. Complete the following steps to override a UI action on the Task table for just the Incident table. - Create a UI action on the Incident table with the same Action name.If the Action name is not defined, use the same Name. Enter a script that is specific to the Incident table. - Complete the following steps to remove a UI action on the Task table for the Incident table. Navigate to the UI action definition for the Task table. Add the condition current.getRecordClassName() !='incident'. 2. We can override the parent table UI action on the child table via setting the 'Override' field.
67
Type of UI actions?
Based on the type of script, it could be divided into 3 types: 1. Client Side. 2. Server Side. 3. Client as well as Server Side. Based on it's position on the form, it could be divided into following types: 1. Button on a form. 2. Context menu item on a form that appears when you open the form context menu or right-click the form header. 3. Related link in a form. 4. Button in the banner on top of a list. 5. Button at the bottom of a list. 6. Context menu item on a list that appears when you open the list context menu or right-click the list header. 7. Menu item for the action choice list at the bottom of a list. 8. Related link at the bottom of a list. Based on the table, it could be divided into following types: 1. Global UI actions. 2. Table UI action.
68
How to write both server side and client side code in UI action? OR What is gsftSubmit() method in UI Action?
UI Actions are mostly used to perform some server-side update to a record/records. In other cases, you can use the ‘Client’ checkbox on the UI Action record to execute some client-side script But what if you need to do both? For example you want to click a button to make an update to a record, but only after successful client side validation. gsftSubmit() is mostly used in UI actions that have a client side and a server side script. At the end of the client side script, gsftSubmit(null, g_form.getFormElement(), "Action name") triggers the UI Action again which is specified in the 3rd parameter, this time only the server side code gets executed.
69
when we use "g_list.getChecked()" it returns the sys_ids of all the selected records but how can I get all the records. I have a requirement that If I don't select any records that means we need all the records.
I don't see any OOb method to retrieve all the records in the list, But this can be achieved by using a GlideAjax call, g_list.getChecked() returns the comma separated sys_ids of the selected records. Here we can use g_list.getQuery() which returns the encoded query of the list filter, then we can pass this to the GlideAjax script include as a parameter, and then in the Script Include we can use this Encoded Query to glide the table, and then return sys_ids of the records back to the client side
70
How to trigger a UI action from list view to perform its functionality only on the selected records?
In UI action, you can use g_list object. It has method g_list.getChecked() which returns sys_id's of all selected records. Once you get sys_id's of all selected records then you can glide into those records and perform required operation further.
71
What is gsftsubmit in UI action ?
With this function, we can write client as well as Server side script in same UI action.
72
What are the different type of script available in transform map?
There are 7 type of transform map script which gets executed at different point of time while transformation, 1. onStart: executes at the start of an import before any rows are read. 2. onAfter: executes at the end of a row transformation and after the source row has been transformed into the target row and saved. 3. onBefore: executes at the start of a row transformation and before the row is transformed into the target row. 4. onChoiceCreate: executes at the start of a choice value creation before the new choice value is created. 5. onComplete: executes at the end of an import after all rows are read and transformed. 6. onForeignInsert: executes at the start of the creation of a related, referenced record before the record is created. 7. onReject: executes during foreign record or choice creation if the foreign record or choice is rejected. The entire transformation row is not saved. Note : In addition to above types, we do have main transform map script (which is available when we click on run script checkbox) and Field Mapping script.
73
What is the sequence of execution for different type of transform map script?
The correct sequence of transform map script is as follows: 1. onStart. 2. on Before. 3. Source Field script. 4. Run script, the script we can find after checking the 'Run Script' check box. 5. onAfter 6. onComplete
74
What are the different variables available in transform map scripts?
1. source: Contains the import source record currently being transformed. Specify a specific field from the source record as an object property. 2. target : Contains the transformation map record currently being used for the transformation process. Specify a specific field from the transform map record with one of these properties. 3. log : Log information about the current import process. Each log level has it\'s own method. 4. ignore : When set to true, skips or aborts the current import action. In onStart scripts, this variable aborts the entire transformation process. In onBefore scripts, this variable only skips the current row being transformed. 5. error : When set to true, aborts the current import action and logs an error message in the Import Set Log. 6. error_message : When an error occurs, adds the specified error message to SOAP response. 7. status_message : Adds the specified status message to SOAP response.
75
What do you mean by Foreign record insert in transform map?
A foreign record insert occurs when updating a reference field on a target table. If reference field doesn't exist then transform map creates new entry in reference table. This behaviour can be managed by 'Choice Action' field on field mapping record.
76
while transforming the data from excel sheet to target table the business rule which has written on target table is that will run or not ?
usiness rules defined on import target tables will be fired if the transform map has set the flag "Run Business Rules" on .
77
How we can add 51-100 record out of 100 record available in Excel file.
Select row header 50. (function runTransformScript(source, map, log, target /*undefined onStart*/ ) { // Add your code here var num = parseInt(source.u_sr_no); if(num <= 50){ ignore = true; return; } })(source, map, log, target);
78
What is Difference Between Business Elasaped time and Actual Elapsed Time?
Actual elapsed time is the total time the SLA has taken from the time SLA start until the SLA completed. Business elapsed time is the total time which is calculated as per Schedule type (Give in SLA form for e.g., 2 business days by 4 pm) and as per time zone. To analyze the exact SLA timing condition, we always see Business elapsed time.
79
What is RetroActive Pause?
If Retroactive pause is checked, any new SLA gets associated to the ticket also considers the pause time. For example, I have 2 SLAs for 2 different group. Both have Retroactive Start is set as ticket creation date. When ticket is created and assigned to first group, SLA1 got associated to the ticket. The ticket was put on hold for 1 hour and then assigned to 2nd Group, which linked the SLA2 to the ticket. Since the SLA2 has Rectroactive Start is set as ticket creation date, it will consider the SLA start time as ticket creation date. Now if the Retroactive Pause is also set for SLA2, it will also consider the 1 hour of pause time, which will extend the SLA breach date by 1 hour.
80
What is Script Include?
Script Include contains set of variables and functions which are executed on server side. It is a reusable script logic which will only execute when called by other scripts such Business Rule, script actions, client script etc.
81
What are the different type of Script Includes?
It is divided into below two types based on where it is being called/used : a. Client callable Script Include: Here Client Callable checkbox is checked and it extends "AbstractAjaxProcessor" class b. Server callable Script Include.
82
What are private functions in Script Include and how to declare function as private?
Private function in Script Include is a function which can only be accessible/called in same or exteded Script Include, it cannot be called from BR, Client Script etc. Private functions can be defined with prefix underscore
83
How to call Script Include from Server side script?
We can call Script Include in any server side script as shown below: var objEmail = new DemoScriptInclude(); objEmail.callEmailBody();
84
How to call Script Include from Client side?
It can be called from client side by using GlideAjax API. To call Script Include at client side we have to make sure that client callable checkbox in Script Include is checked and Script Include class is extending class ‘AbstractAjaxProcessor’.
85
How to call one function of Script Include to another function of same Script Include?
We can call internal function in the same Script Include as mentioned below: this.functionName();
86
What is initialize() function in Script Include? And when it gets executed?
The initialize() function acts as constructor which can be used to set default values of variables. This function automatically gets executed when we create object of Script Include class.
87
can we use script include during onLoad client script?
Yes, you can call script include in onLoad client script by using GlideAjax.
88
How to call script include in background script?
var scriptInludeVariable=new ScriptIncludeName(); //Replace ScriptIncludeName with your script include name scriptInludeVariable.functionName();//functionName-> One of the function name from your script include
89
How to move changes from dev instance to prod in ServiceNow?
Update Sets is the way ServiceNow allows its users to move updates from one instance to another. It is an XML file containing its own identifying information, the list of changes recorded in the source instance and data to determine whether the target instance can accept the changes or not.
90
What are the different ways to move update set from one instance to another?
There are three different ways: 1. Transferring with an XML file -> We can unload an update set as an XML file and then upload and commit it to another instance. 2. Transferring via update sources. -> We can go to 'Update sources' module via navigation and configure source instance to retrieve update sets from. 3. Transferring with IP access control.
91
Which method of transferring update set is considered as best approach?
Transferring via update source.
92
Provide two issues that could be faced while previewing update set?
1. Found a local update that is newer than this one. 2. Could not find a record in sys_scope for column sys_scope referenced in this update. Note : There are many common preview errors we get so you can remember them if you come across it.
93
How to identify if the particular table changes get captures in update set or not?
The collection dictionary entries of the table whose attribute contains update_synch=true gets capture in update set.
94
How to transfer the changes which don't get captured in update sets?
Here are two ways: 1. Transfer record via XML export. 2. We can use GlideUpdateManager2 API script as shown below which allows us to capture any record in current update set: var um = new GlideUpdateManager2(); um.saveRecord(current); //current is gliderecord object, you can pass any other gliderecord object if required. Note : This script needs to run in background script.
95
What is default update set? What its purpose? How it is managed by ServiceNow?
Basically Default update set is system generated update set. Only one update set can be the default set for any application scope. To set an update set to be the default, you need to set the 'Default Set' field to true. When you set Default set = true, the following actions occur: 1. The update set becomes the default update set for its scope. 2. The system sets Default set = false for all other update sets with the same scope. This ensures that there is only one default update set for each scope.
96
What happens if we mark default update set as Complete/ignore?
System generates new update set with the name Default1 which will be used as default in future.
97
What is merged update set? what are the advantages and disadvantages of moving update sets by merging?
Merging an update set creates a new update set and combines all customer updates from all update sets in a merged update set. The latest update overrides the oldest one. Suppose ServiceNow Update set A contains the latest update of Client Script than Update set B. Merged update keeps the update form A as the latest one. It reduced the risk of missing/overriding the latest updates. When you merge into an update set all changes are moved into the same update set and when you create batch child relationship you are not merging the changes into one update set, you are building a parent-child update set hierarchy. So it's easier to identify changes/versions into batch hierarchy than merged update set because all changes and versions are combined. The most relevant thing it's when you need to back out some specific change or update set. If you have created a merge you are not going to be able to just back out some specific change or update set, you need to back out the entire merged update set.
98
What is an update set
A group of configuration changes that users can move from one instance to another is called an update set.
99
Batching Update Sets vs Merging Update Sets
Update Set Batching The concept of batching update sets was introduced as an improvement to update set management with the Jakarta release. Batching update sets via the parent field allows users to group several update sets to be released all at once. This concept has replaced and improved upon the methodology of merging update sets. When developers batch update sets, they’re able to move and review them easily between instances. Instead of having to back out an entire release, they can back out single update sets or entire sub-batches (branches). Why batch update sets? Because dealing with multiple update sets can cause a wide range of problems, such as inadvertently leaving out a set (or more) or committing them in the wrong order. By grouping completed updates sets into a batch, these problems can be avoided. Updated set batches are organized into a hierarchy where one update set can function as the parent for several child sets. A set can be both a parent and child, which enables the creation of hierarchies on multiple levels. The update set at the top of the hierarchy is called the base update set. When you commit or preview the base update set, you commit or preview the whole batch. Merge Update Sets The merge update sets feature allows developers to merge multiple update sets into a new update set. During this process: · No update sets being merged will be deleted · The latest update from all the update sets will be put into the new update set · The older updates will stay in the original update set When the merging is finished, it will show you the changes that were moved or skipped (like the collision report). Just like batching update sets, merging update sets is performed to simplify the update sets transfer process. Once update sets have been merged, they cannot “unmerge.” Navigate to System Update Sets and click on Merge Update Sets (the list will show you only those update sets that are in progress), or click on Merge Completed Sets to get a list of completed update sets. Then, you should enter a name and description for the new update set and click Merge. It is recommended to scroll down to the Merged Update Sets list and open the old update set records to verify that the right changes were moved to the new set. Also, you should empty or delete the original update sets, so you don’t risk committing an older update set.
100
What does not capture in Update Sets
1) Data changes mean - records such as Incidents, Problems, Change request will bot be captured in update sets. 2) Yes. Simple, advanced and dynamic reference qualifier will be captured in update sets. 3) Yes. Dictionary Override will be capture in update sets. users, roles or groups and reports, scheduled jobs, homepages etc
101
How to move a particular change from one update set to another update set.
Yes if you go into your update set and then open the specific update you want. At the bottom there should be a reference filed with the current update set name in it. Just change that to the update set name you want it in and save the record. Edit: You do have to be carful with certain records like business rule especially if they already exist in the update set as it always updates the same record. If that is the case I would move the update to the default update the then switch to the correct update set and make a minor change to the the BR such as adding a comment.
102
How to encrypt and decrypt a attachment record which is being attached on Incident record?
You can find the "Column Level Encryption." course in Now Learning. To encrypt the attachment or particular field.
103
what is difference between normal update set and batch sets
Primary difference is that batch update sets enable you to group update sets together so you can preview and commit them in bulk on the other hand normal update set is single entity which can be committed separately. Dealing with multiple update sets can lead to problems, including committing update sets in the wrong order or inadvertently leaving out one or more sets. Therefore, SN has introduced concept of batch update sets ( but many people now use merge update set functionality, both methods have its pros and cons) The system organizes update set batches into a hierarchy. One update set can act as the parent for multiple child update sets. A given set can be both a child and parent, enabling multiple-level hierarchies. One update set at the top level of the hierarchy acts as the base update set.
104
Explain change management life cycle?
ServiceNow largely complies with the core aspects of ITIL for its change management process. ServiceNow follows below lifecycle in change management. 1. New: A need for a change is identified and a change request is initiated. 2. Assess: The created change is then extensively assessed by a person of authority who governs the change process and a decision is taken whether to accept or reject the requested change. 3. Authorize: Once the change is deemed as necessary, its impacts, benefits and risks are reviewed to avoid any unnecessary disruption of IT setup. It is evaluated by the leadership and all stakeholders, who will be impacted by the change and then it is given an approval. For high-priority changes, which might impact the overall business operations, the Change Advisory Board (CAB) is also consulted. 4. Schedule: The initiated change is scheduled for implementation in such a way that no work disruption occurs. 5. Implement: With the approvals and schedule in place, the necessary changes are implemented in the IT system. 6. Review: The implemented change is tested and verified to ensure it is working in the intended manner and if any component of the whole change ecosystem is broken. 7. Close: When a change is closed, all related and associated incidents/ problems are closed automatically. 8. Cancel: There is an additional option to cancel any change requests that are initiated. The reason for cancelling the change is added to the Work Notes field.
105
What is difference between change and request, when we are supposed to raise change vs request?
Requests typically have the following characteristics: - Approval is automatically granted by the delegated authority. - The tasks are well known, documented, and proven. - Authority is effectively given info in advance for the change. - The request is included as part of the service offering. - The risk is usually low and well understood. e.g. Password reset, Account Creation etc. Change Request have the following characteristics : - A change request requires authorization by the Change Advisory Board (CAB). - A change request might involve a significant change to the service or infrastructure. - It might carry a high degree of risk. e.g. Request to promote code from one environment to another.
106
What is CAB in change management?
Change advisary board in short known as CAB is group of people who assess, authorize, priorize the changes and control the process. The owner, manager, architects, project managers of the service or infrastructure should approve the changes with an agreement with business owners.
107
Explain relation between change, incident and problem with example?
Let's say your VDI is working very slowly around 4 to 5PM, this will be considered as unplanned disruption of service therefore you will raise an incident. The corresponding team will look into the issue, and try to find out the root cause. Let's assume issue exist due to heavy traffic in Asia region server. So, as a work around they might ask you to connect to the EMEA server which might resolve your issue for the day. Suppose many Asia region users are facing this issue daily and they start raising incidents, this multiple incident for the same issue will be considered as problem and problem record will be created to find paramanant solution. Once problem record is created, technical team will start investigating the issue as part of problem process. Assume that they find out the root cause as Asia people also join in EMEA shift around 4-5 PM therefore load is suddnly getting increased on Server. So, they plan to increase the server capacity to handle more users. As increasing Server capcity is big unplanned significant change therefore it requires change request to be created to deploy these changes on required Server.
108
what are the ITSM Implementation steps in step by step not theoretical but in practical steps how do you implement ITSM?
Assessment and Planning: Understand current processes, identify gaps, and define goals. Create a roadmap detailing the implementation process, including roles, responsibilities, and timelines. Tool Selection and Configuration: Choose an ITSM tool aligned with your organization's needs. Customize and configure the tool to support defined processes and workflows. Process Definition and Documentation: Document ITSM processes based on industry best practices like ITIL. Ensure clarity on roles, procedures, and communication channels. Training and Communication: Provide comprehensive training to staff on new processes and tools. Communicate changes effectively across the organization to gain buy-in and support. Continuous Improvement: Establish metrics and KPIs to measure process efficiency and service quality. Continuously review and refine processes based on feedback and data analysis to drive ongoing improvement.
109
What is lead time in change management
Lead Time is used to compute the Earliest Start Date and uses the Business Hours and holidays configured for the Change Manager's support group.
110
What are the priority tickets and how the tickets are classified as p1,p2,p3,p4 and their response time and resolution time sla?
Tickets are prioritized based on the Impact and Urgency of the tickets. Impact is calculated based on the number of users, operational, financial and regulatory impacts on the business. Where as Urgency is calculated by from the business requirements of the service that is interrupted. The tickets response time and resolution time will be a part of the SLA that is agreed.
111
What is Blackout and Maintenance window in change management?
Blackout windows specify times during which normal change activity should not be scheduled. Maintenance windows specify times during which change requests should be scheduled.
112
your client is asked to implement approval for standard change.. then how can you achieve this.
You can achieve this by modifying the OOB change workflow. Navigate to the Workflow Editor. Select the Standard Change Proposal from the available workflows. Use the Hover over feature for the Change Manager Group Approval Approval - Group activity. If the Approvers.Groups value only shows the sys_id a715cd759f2002002920bde8132e7018, the original base system group has been removed from your instance and you will get this error. Edit the workflow, and ensure the Approval - Group activity has a valid group specified for the Approvers. This group must have members, and the group must also have the role change_manager. If the original Change Management group is still in your instance, make sure you add the users to the group.
113
What is affected CI?
Affected CI in ServiceNow is about understanding relations between CIs and services. Being aware of this is crucial for managing incidents, problems, and changes well. Adding affected CIs helps with making decisions, prioritizing tasks, and resolving issues.
114
How do you create a new type of change?
There are several processes involved with adding a change type. These processes include managing script includes and workflows. https://docs.servicenow.com/bundle/washingtondc-it-service-management/page/product/change-management/task/t_AddNewChangeType.html
115
What is primary goal of Incident Management?
Incident Management restores normal service operation while minimizing impact to business operations and maintaining quality.
116
What is difference between incident, major incident and security incident?
Major Incident : A major incident (MI) is an incident that results in significant disruption to the business and demands a response beyond the routine Incident Management. Incident : An incident is an unplanned interruption to a service, or reduction in the quality of a service. We could say it has less impact or urgency as compare to Major Incident. Security Incident : An Incident which is related to security of an Organisation can be considered as Security Incident. Example : Phishing attack email - > When you report phishing emails, many organisation automate to generate Security Incident in the backend.
117
What are the main stages of the incident management process?
There are five steps in an incident management plan: Incident identification Incident categorization Incident prioritization Incident response Incident closure However, ServiceNow Incident Management supports the process in the following steps: Incident Identification Incident Logging Incident Categorization Incident Prioritization Incident Assignment Initial diagnosis Escalation, as necessary, for further investigation Incident resolution Incident closure
118
How to associate multiple Business Services or CI's to one incident?
When you populate the ‘Business Service’ and the ‘Configuration Item’ fields on the incident form and save the record, the selected values appear on the “Impacted Services/CIs” and “Affected CIs” related lists respectively. If we want to add multiple affected CIs or impacted services, we can do it by adding multiple records in related lists.
119
How to close incident after 3 days of resolution?
OOTB there is system property "Number of days (integer)", this property stores integer value, based on the value resolved incidents are automatically closed after those many days. We can set this property value to 3 to close it after 3 days of resolution. There is OOTB scheduled job "Autoclose Incidents" which runs every hour and uses this property to auto close resolved incidents.
120
What is Urgency and Impact in Incident Management, how it is measured?
Impact is a measure of the extent of the issue and of the potential damage caused by the incident before it can be resolved. This can be based on several factors including the number of affected users, potential financial losses, and criticality of affected services. Urgency is a measure of the business criticality of an incident, when there is an effect upon business deadlines. The urgency reflects the time available to restore service before the impact is felt by the business.
121
When should we raise an Incident vs. a Request?
Raise an incident when there is any unplanned interruption or degradation in the quality of an existing IT service and create a request when you want to put a formal request to the IT service desk to provide something. A request can be for a new hardware or application, information, training etc. Example: If the existing RAM in your system is malfunctioning, then raise an incident but if you want a new RAM for your system, raise a request. Incident Requests are requests that denote the failure or degradation of an IT service. For example, unable to print, unable to fetch mails and so on. Service Requests on the other hand are requests raised by the user for support, delivery, information, advice or documentation. Some examples are installing software in workstations, resetting lost password, requesting for hardware device and so on.
122
I have asked scenario where If OOB ServiceNow Incident management application is installed and you need to configure it for end users so what configuration you should required to do?
When configuring the out-of-the-box (OOB) ServiceNow Incident Management application for end users, there are several key configurations you should consider to ensure it meets your organization's needs. Here are the essential configuration steps: User Roles and Permissions: Define and assign appropriate roles to end users, such as "Incident Caller" or "End User." These roles should have the necessary permissions to create, view, and update incidents. Service Catalog Configuration: If incidents can be reported through a service catalog, configure catalog items for incident creation. Define the variables and information you want end users to provide when reporting incidents. Incident Categories and Subcategories: Set up incident categories and subcategories to classify incidents effectively. This helps in routing incidents to the correct assignment groups and analyzing incident data. Assignment Groups: Define assignment groups responsible for handling different types of incidents. Configure automatic assignment rules based on incident category, subcategory, or other criteria to ensure incidents are routed to the appropriate teams. Service Level Agreements (SLAs): Set up SLAs to define response and resolution time targets for incidents. Associate SLAs with incident categories or priorities to ensure that incidents are prioritized correctly. Incident States and Workflow: Configure incident states and workflows to match your organization's incident management process. Define the stages an incident goes through from creation to closure and customize the workflow to meet your needs. Notifications and Email Templates: Configure notification rules to keep end users informed about the progress of their incidents. Create and customize email templates for incident notifications to ensure clear communication. Knowledge Base Integration: Integrate the incident management application with the knowledge base to provide end users with access to self-service solutions and knowledge articles that can help them resolve common issues. Incident Numbering and Prefixes: Customize incident numbering and prefixes to align with your organization's numbering conventions and to make it easier to identify and track incidents. Incident Templates: Create incident templates to simplify the incident reporting process for end users. These templates can pre-fill incident fields with common information. Client Scripts and UI Policies: Implement client scripts and UI policies to enhance the user experience by adding client-side validation and dynamic behavior to incident forms. Service Portal Configuration (Optional): If you're using ServiceNow's Service Portal, configure incident-related widgets and forms to provide an intuitive and user-friendly interface for end users. Access Control Lists (ACLs): Define ACLs to control access to incident records and ensure data security and privacy. Reporting and Dashboards: Set up incident-related reports and dashboards to provide end users with visibility into incident trends and performance metrics. Testing and Training: Thoroughly test the configuration to ensure it meets end-user needs and aligns with your incident management processes. Provide training to end users on how to use the system effectively. Documentation: Create user guides and documentation to help end users navigate the incident management application and understand their roles and responsibilities.
123
What are major incidents? Are all P1 incidents are major incidents?
So a major incident will be subjective to your own company, IF you choose to use it- it's basically anything that should set off an alarm or siren for IT, and pull a significant number of people off of planned work. Think of it like a natural disaster (earthquake, meteor strike, kaiju attack); it's going to mean a lot of hands on-deck and will need to be addressed immediately before anyone can get back to work. It's really just a matter of scale. Not to be confused with Problem, which addresses the root cause of one or more incidents (I like this graphic for visualizing it). The two aren't exclusive, and I'd argue that any Major Incident should probably have a Problem ticket filed to deal with the fix. Some examples: Major incident: Nobody can access ANY network resources. Goal is to get everyone back online as quickly as possible. (Temp Solution: reboot the DC that went down) Problem: The DC went down- why did it go down? Will it run out of memory again? What changes do we make to keep it from crashing again? (Permanent Solution: to divest from McAfee and uninstall it across all servers) Major Incident: Skype is suddenly down and won't work again. Goal is to get Skype back for everyone ASAP. (Temp Solution: Deskside techs go around and use a custom installer to reinstall Skype for all users) Problem: A MS data center in TX got hit by lightning and borked everything to do with Skype for certain clients. (Permanent Solution: Pray). All Major Incidents are Prio 1
124
What is notification and why it is used?
Email notifications are used to send users email or notifications about specific activities in system, such as updates to incidents or change requests.
125
How to call email script into notification?
We can use below syntax in notification body : ${mail_script:mail_script_name}
126
What is watermark in notification and why it is used?
By default, the system generates a watermark label at the bottom of each notification email to allow matching incoming email to existing records. Each watermark includes a random 20-character string that makes it unique.
127
How many ways notification can be triggered?
1. It can be configured to trigger on insert/update of the record. 2.It can be triggered through server side script by using gs.eventQueue method. 3.Through Flow Designer. 4.Through workflow by using event activity or notification can be configured in workflow itself.
128
How to add people in cc and bcc in notification?
We can use below line of code in email script: email.addAddress(String type, String email address, String display name): \\type can be cc or bcc. e.g. email.addAddress('cc','abeltuter@service-now.com','Abel Tuter')
129
What is the use of 'Send to Event Creator' checkbox?
If user who triggers the event is in recipient list then he will receive the notification if this checkbox is checked.
130
When we create a notification, if we use email template which has subject and body in it. Also the notification has subject and body? Which will get priority?
Notification subject and body will get priority. If notification does not have subject or body then it will be used from template.
131
What is email layout?
Email layout is reusable template which can be used in multiple notifications.
132
What parameters we can pass in gs.eventQueue method?
Generally four parameters are passed to eventQueue method but we can also pass an optional 5th parameter: 1. Event name. 2. GlideRecord object, typically current but can be any GlideRecord object. 3. Any value that resolves to a string. This is known as parm1 (Parameter 1). 4. Any value that resolves to a string. This is known as parm2 (Parameter 2). 5. (Optional) Name of the queue to manage the event. Syntax : gs.eventQueue('event_name',current,'param1','param2');
133
How to schedule notification to trigger at particular date and time?
We can schedule notification by using gs.eventQueueScheduled method. It accepts parameters as shown below, gs.eventQueueScheduled('event_name', current, 'parm1', 'parm2', DateTime object);
134
What are the notification related objects we can access in email script?
1. Current: This object refers to current gliderecord object on which the notification is created and you can access all field values from current object. 2. Template: using Template object you can print the values of the fields in the notification. 3. email: This object stores multiple variable fo the notification e.g. email.body_text -> Contains the body of the email as a plain text string. 4. event: If the email notification is triggered through event, then event parameters can be accessible as event.parm1 or event.parm2.
135
How to manage notifications for multiple languages?
Creating multilingual notification is a usual ask in any customer instance having multiple languages. There are multiple ways to configure it and SN suggests to create separate notification for each language. Translating Email Notification - Support and Troubleshooting (servicenow.com) However I have configured in similar way for some customers but this time I thought to give it a try to utilize with single notification. Here is my approach. 1. Activate the respective language plugin. Translating Email Notification - Support and Troubleshooting (servicenow.com) 2. Create a new notification with the content being generated from mail script. find_real_file.png 3. Create language respective message in System Localization > Messages English:
136
How notifications are managed in lower instances so that they don't trigger to end user?
Usually in DEV instance email sending is disabled in email properties In TEST instance usually it's the email address of testing team users so that they can verify the email content, layout etc In PROD it's enabled so that end users receive emails
137
What is the use of stop processing check box in inbound email action?
All Inbound actions process according to the order value defined. When "Stop Processing" checkbox is set to true it will stop processing further inbound email actions.
138
What is the use of allow digest checkbox in notification
With digest functionality end user has option to subscribe for digest notification so that he receives single consolidated notification for certain time period. e.g. Let's say we have "Incident Commented" notification which triggers every time comment is added into incident. If end user subscribes to receive it for 1 day interval then instead of receiving notification for each comment on Incident, he will receive single consolidated digest email for a day.
139
what does weight field do in notification?
his is very important and common interview question. Below is the use of weight field in notification. - With the same target table and recipients, the system only sends the notification with the highest weight. - The default value weight 0 causes the system to always send the notification (assuming the conditions are met)
140
What is service catalog item?
A Catalog Item is a form used to submit information, a request, or to create a task. Catalog Items contain questions that gather information from users to create a record in a table.
141
What are the 4 main building blocks of a Catalogs?
1. Standard catalog items : A catalog item can be a good or service. If something can be ordered by itself, it is a catalog item. 2. Record Producers : A record producer is a specific type of catalog item that allows end users to create task-based records, such as incident records, from the service catalog. 3. Order Guides : Order guide submits a single service catalog request that generates several items. 4. Content Items : A content item is a service catalog item that provides information instead of goods or services. In short, it shows the information rather than gathering information from user.
142
What is the difference between Catalog item and Record Producers?
Catalog Item - Uses cart and creates a REQ, RITM for each submitted entry. Mostly has 1 REQ corresponding to 1 RITM whereas Record producer - Does not create or uses Cart. Inserts records in table directly. For eg. Incident, Change request. We cannot attach workflow to record producer whereas we can attach workflow to catalog items.
143
What are the advantages of Variable Set?
They reduce the time to create a new catalog item due to reusing existing variables, catalog UI policies, or catalog client scripts that are common across multiple catalog items. They simplify the process of making a change to a variable, catalog UI policy, or catalog client script used across multiple catalog items due to having to make the change only once in the variable set.
144
Explain the 3-record structure of record produced by Catalog Items?
1. The top layer is your Request. You can relate it to your order ID form amazon where you can order multiple things in 1 go. 2. The second layer is RITM -> these are the individual items ordered. There can be 1 or more items that can be part of 1 order. 3. The third layer is catalog task (sc_task) -> these are the tasks that individual teams do to fulfill 1 RITM.
145
What is the significance of the cascade variable checkbox in the order guide?
Checkbox to select whether the variables used should cascade, which passes their values to the ordered items. If this checkbox is cleared, variable information entered in the order guide is not passed on to ordered items.
146
can we add workflow to record producer and if yes how can we do it
For associating flow/workflow to record producer you dont have to attach a flow or workflow from the list view of record producers rather just set the condition as Created/Updated on table which you used for Record producer. Trigger condition in flow i.e. Service catalog is not valid for Record Producers.
147
How to configure catalog item ABC in 2nd page of order guide?
You can use rule base and set the order of catalog item. The purpose of a rule base on an order guide include catalog items into your order depending on when you want to include the item. For example, if you have a new hire order guide with checkboxes for applications for users to request, you can configure each application checkbox to have a specific catalog item added to your order.
148
what is Rule base and How to used it
By using rulebase we can add the catalog items to a order guide.
149
What is the use of the inherit checkbox in service catalog?
Indicates whether the client script applies to extended tables. To allow tables to inherit a client script, the inherit checkbox must be set.
150
What is user criteria, and what is their importance?
User criteria defines conditions that are evaluated against users to determine which users can access service catalog items.
151
Is there any restriction for record producer? will it be applicable for all the tables or any restriction.
A Record Producer is designed to create a record in a specific target table. When you create a Record Producer, you specify the table where you want the new records to be created. It means that for each table where you want to use a Record Producer, a specific producer needs to be configured for that table. - Table Level: Access controls (ACLs) apply to Record Producers. If a user does not have the permission to create records in the target table, they won’t be able to successfully use the Record Producer even if they can access and submit the producer form. - Field Level: Similarly, field-level security applies. If the Record Producer attempts to set a value in a field that the user does not have access to (write access), that particular field value might not be set as expected, depending on the design of your ACLs.
152
what is rendering and what is the use of it?
Renderers define a specific look and feel for a catalog or category. use renderers to specify the following formats: How catalogs appear on the multi-catalog homepage. How categories appear on a catalog homepage. For example, you can create a renderer showing the category homepage image, the description, and the first two catalog items in a category.
153
How would you integrate the Service Catalog with other ITSM processes in ServiceNow?
By using Record Producer, it allows you to create table based records e.g. Incident, Problem etc. With this you basically involve ITSM tables/processes with Service Catalog.
154
When user is trying to submit a P1 INC, display a confirmation message that "you are trying to submit Critical incident (P1), would you like to proceed?" it should display yes or no options, if user selects Yes then proceed with the incident submission, if user selects No then stop the form submission to the database
You can write on Submit Client Script with below line of code : var incPriority=g_form.getValue("priority"); if(incPriority==1){ var userInput=confirm("you are trying to submit Critical incident (P1), would you like to proceed?"); if(userInput==false)//user selected no return false; } } return true;
155
What is Widget in Service Portal?
Widgets are reusable components which make up the functionality of a portal page. Widgets define what a portal does and what information a user sees. ServiceNow provides a large number of baseline widgets. Examples include: Approvals Knowledge Base My Requests
156
What is difference between widget and widget instance?
A Widget is the code template used to display content in the portal. A Widget Instance is created when a Widget is added to a Page. Every time a Widget is added to a Page it creates a new Widget Instance. Each Instance can be configured separately, allowing the same code template to be applied to different configurations. This allows a single Widget like the Simple List Widget to render multiple different types of content like a list of Incidents, a list of Links, or a list of Change Requests.
157
How to pass data from one widget to another widget?
We can use $emit, $broadcast and $on to send and recieve the data. - Example by using $broadcast Include below code in client controller on source widget to send data. $rootScope.$broadcast('dataEvent', data); Include below code in client controller on target widget to recieve data. $scope.$on('dataEvent', function (event, data) { console.log(data); // 'recieved data' }); - Example by using $emit Include below code in client controller on source widget to send data. $rootScope.$emit('dataEvent', id); Include below code in client controller on target widget to recieve data. $scope.$on('dataEvent', function (event, data) { console.log(data); // 'recieved data' }); Avoid the use of $rootScope.$broadcast() because it can cause performance issues.
158
How to pass data from one portal page to another portal page?
To access data between two pages, we need to send data via URL as shown below. Set URL as below on source page client controller : function ($scope, $window) { var c = this: c.onClick = function () { $window.location.href = "/sp?id=new_portal_page&incidentNumber=" + INC00001234; } } On the server side of the target page, we can use below code to access those parameters: var incNumber = $sp.getParameter('incidentNumber');
159
How to pass data from Server side to client side in widget?
We have data object to store data on server side script which later can be accessed in client script as shown in below example. Server side script : data.myNumber = 10; data.myID = gs.getUserID(); //store data in myID variable Client side script : var userID = c.data.myID; //access stored data here
160
How to pass data from Client side to Server side in widget?
We can use c.server.update() method to execute server side script again where it can access client side 'data' object as 'input' object. Example : Send incident number from client side to server side code and get associated assignment group. Client Script Code : function() { /* widget controller */ var c = this; c.data.incNumber = "INC0001234"; c.data.actionName="getIncidentAssignmentGroup" c.server.update().then(function(response){ console.log(response.assignment_group; }); } Server side code : if (input) { if (input.actionName == "getIncidentAssignmentGroup") { var grIncident=new GlideRecord("incident"); if(grIncident.get("number",input.incNumber){ input.assignment_group=grIncident.assignment_group; } } }
161
What is the difference between Service Portal and Employee Center Portal
Key Differences Service Portal: Broad service access, highly customizable for various users. Employee Center Portal: Tailored for employee-specific needs, combining HR, IT, and other services into one portal.
162
how to show different different portals for different user roles.
This can be achieved by cloning the OOB SPEntryPage. Once the custom script include is created, you need to modify the below system properties: glide.entry.first.page.script - set the value as new NAME_OF_NEW_SCRIPT().getFirstPageURL() glide.entry.page.script - set the value as new NAME_OF_NEW_SCRIPT().getLoginURL() if(user.hasRole('admin')) { gs.log("Admin Redirection 1"); return "/?.do"; } else if (user.hasRoles() && !redirectURL && !isServicePortalURL) { gs.log("Redirection 1"); return "/?.do"; } else if (user.hasRole('sn_customerservice.consumer') && !redirectURL && !isServicePortalURL) { gs.log("Redirection 2"); return "/csm"; } else if(!user.hasRoles() && !redirectURL && !isServicePortalURL) { gs.log("Redirection 3"); return "/sp"; } Here you need to make sure that the hasRole check for admin user should always be the first if condition. gs.hasRole returns true for any role for an admin user. This is an expected platform behavior. Here you want also want all the users to have a common login page, and the redirection should happen after login. In that case, you can remove the Login Page from the portal records, so that all the users land on login.do Also, you need to change line 22 on the custom script include from: this.portal = "/sp/"; to this.portal = "/login.do";
163
What all things are copied when you clone a widget?
Everything other than name and ID.
164
What is workflow?
Workflow consists of a sequence of activities, such as generating records, notifying users of pending approvals, or running server side scripts.
165
Name 5 activities that you used for your requirement and its usage?
You can mention activities that you have used so far. However, below are the common activities, 1. Approvals : Group, User or Coordinator approval etc. 2. Conditions : If, Switch, Wait for Condition etc. 3. Run Script. 4. Notifications: Create Event, Notifications. 5. Create Task.
166
What is turnstile workflow activity? or How to avoid workflow going into infinite loop?
We can use Ternstile activity. The Turnstile activity limits how many times a workflow can pass through the same point. This activity is useful alongside the Rollback To workflow activity.
167
How to pass data from one activity to other activity?
By using workflow.scratchpad object e.g. Store value in one activity as below, workflow.scratchpad.group_name=grIncident.assignment_group; Access it in another activity as below, var groupName=workflow.scratchpad.group_name.
168
How to pass data from main workflow to sub workflow?
Configure the subflow to accept variables from the parent workflow by defining the inputs. Include the subflow in the parent workflow and connect the inputs to the parent workflow variables.
169
How to get values from subflow to main flow?
We can use the Return Value activity in the subflow to return values to the parent workflow.
170
What is Rollback To workflow activity?
Rollback To determines which activities to reset based on the actual workflow sequence (transition line attachments) of activities between itself and the transitioned to activity, not the execution order. Rollback To then marks all the approvals that have transitioned between the rollback and the transitioned to activity as Not Yet Requested and the tasks as either Open or Pending.
171
What is turnstile workflow activity?
Under Utilities, turnstile activity is available. It is a workflow activity which limit times of a workflow can pass through the same point. Actually, It prevents the infinite loops. For e.g. we can provide allowed iterations count while using this activity.
172
How can we fetch variable from one workflow to other
https://www.servicenow.com/community/developer-forum/how-pass-variable-of-on-workflow-to-another-workflow/m-p/1878823
173
flow designer vs workflow 5 points, which will be used and when?
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0789014
174
Difference between workflow and flow
1. Flow can be scheduled, workflow cannot. 2. Flow have multiple triggers e.g. Inbound email triggers, Application triggers and Rest Triggers, workflow can be triggered based on record creation or update.
175
how to get all variables in task form using script in workflow.
You can access variables in workflow by using below syntax. current.variables.variable_name (variable_name -> this will be your actual variable name ) https://www.servicenow.com/community/developer-articles/adding-variables-to-a-task-via-a-script-instead-of-using-the/ta-p/2302808
176
how to create change request approval policy in servicenow
There is "Change Approval Policies" module in change management where we can create these policies. It is a course of action that can be applied to a change request. It uses a set of variable inputs to evaluate the decisions that are associated with it. For each matching decision, the associated approval definition is applied.
177
How can you set the approvals in a way, Where if more than 50 percent approvers have approved- approve the request else vice-versa.
We can write script in approval activity as below to identify if 50% approvals are approved or 50% are rejected based on result take action. Approval activity script : //Approve based on percentage indicated var approvePercent = 50; if((counts.approved/counts.total)*100 >= approvePercent){ answer = 'approved'; } if((counts.rejected/counts.total)*100 > (100 - approvePercent)){ answer = 'rejected'; }
178
When to use Flow Designer vs Workflow?
Workflow can be used in following cases: 1. If the process requires complicated or scripted logic, it can be written in a Workflow. 2. Changing logic already developed using Workflows. 3. SLA timer is required. 4. Steps required do not exist yet in Flow Designer and require unsupported protocols. Use Flow Designer when: 1. Process owners need to use natural language and low code way to automate approvals, task, notifications and record operations. 2. New logic needs to be developed and it has not been created in workflow. 3. Business logic needs to use the library of reusable actions across multiple flows.
179
What are the benefits of flow desinger?
1. Provides a list of reusable flow components in the base system and helps reduce development cost. 2. Reduces upgrade costs, with upgrade-safe platform logic, replacing complex custom scripts. 3. Develop, share, and reuse your custom flow components with other flow designers. 4. Integrate with external instances and third-party applications with the use of IntegrationHub. 5. You do not have to script. Natural language descriptions are used to help non-technical users to understand triggers, actions, inputs and outputs. 6. Combines multiple platform automation capabilities, configuration, and runtime information so process owners and developers can create, operate, and troubleshoot flows from a single interface.
180
What are the different types of flow trigger?
1) Record Triggers: Starts a flow when a record is created or updated This trigger has three different options: i) Created: Starts a flow when a record is created in a specific table. ii) Updated: Starts a flow when a record is updated in a specific table. iii) Created or Updated: Starts a flow when a record is either created or updated in a specific table. 2) Rest Triggers: This is used to start a flow after a specific REST API request. 3) Scheduled Triggers: This is used to start a flow after a specific date and time or repeatedly at scheduled intervals. Scheduled triggers use the instance timezone to determine when to start a flow. 4) Application Triggers: This is used to start a flow when application-specific conditions are met. This has three different sub trigger options as below : i) MetricBase : Starts a flow when a MetricBase trigger is met. Requires the MetricBase application. ii) Service Catalog : Starts a flow from a Service Catalog item request. iii) SLA Task : Starts a flow from an SLA Definition record. 5) Inbound email triggers: Start a flow when instance receives an email.
181
How can you execute activites/action/task parallely in flow designer?
We can use flow logic "Do the following in parallel" this lets us execute multiple set of flow actions parallely.
182
How data is shared between two activities in Flow Designer?
We can use flow variables for passing values from one flow action to another in Flow designer. Also, we have Data panel and data pill picker to access global variables which are available at flow level.
183
How to call subflow/flow from client script?
ServiceNow has provided "FlowAPI" class to call Flow/Subflow/Actions by using scriping. However, this can only be called from Server side scriping. So, when we want it to be called from Client side, we can use GlideAjax to invoke server side script which will trigger Flow/Subflow/Actions. https://servicenowinterviewbuddy.com/snib_flow_designer_queries.php
184
How to trigger integration by using Flow Designer?
We have in built "Rest Step" in Flow designer to trigger integration. However, this step is not available in the base system and requires the ServiceNow Integration Hub subscription. After the required plugin is activated, the step is visible under Integrations. https://www.servicenow.com/community/developer-articles/outbound-rest-integration-using-flow-designer/ta-p/2308300
185
What are the different stages of Flow Execution?
During flow execution, each stage can be in one of five states. 1. Pending - This stage has not yet started. 2. In progres - This stage is executing. 3. Skipped - This stage was skipped and did not run. Typically, this state is reached when a conditional flow logic block is not executed. 4. Complete - This stage is complete. 5. Error - This stage has reached an error condition.
186
What is ServiceNow Integration?
A ServiceNow integration is an information exchange between the ServiceNow Platform and another system or source.
187
What is inbound integration in ServiceNow? Explain one of the inbound integration that you have implemented?
Inbound integration is making call from third party application to ServiceNow's REST API to get information from ServiceNow, or create/update records.
188
What is outbound integration in ServiceNow?
Outbound integration is making calls from ServiceNow to other applications API to get information or create/update records.
189
What is a MID server?
A management, instrumentation, and discovery (MID) Server is a Java application that runs on a server on your local network. MID Servers facilitate communication and data movement between a single ServiceNow® instance and external applications, data sources, and services. A mid server sits inside firewall, collects information from infrastructure CIs, then puts that info out in the cloud in ServiceNow instance.
190
Why we need MID server?
ServiceNow instance is hosted in the cloud. It can connect to other cloud based systems to share data etc, however your internal network is likely not wide open to connections from external systems. So the MID server acts as connection between your internal network and the ServiceNow instance. It can be used to send Discovery data that it collects on your network to the ServiceNow instance. It can also allow ServiceNow to connect to data sources that are on your network (like SQL servers, internal APIs etc)
191
Types of http methods?
There are 5 basic http methods which are as follows, GET : Retrieves information. POST : Creates new records. PUT : Updates the partial or specific records, it checks if resource exists then it will update the record or else it creates record. PATCH - > Updates record. DELETE : Deletes record.
192
What is difference between PUT, POST and PATCH method?
POST is used only to create records whereas PATCH is used to only update the record while PUT is kind of combination both where if record exist then it will update the record otherwise it creates new one.
193
What is OAuth method?
OAuth is an open standard for token based authentication. It allows user access instance resources by obtaining Token rather than entering login credentials with each resource request.
194
What is Table and Import Set API?
able API allows us to perform create, read, update, and delete (CRUD) operations on existing tables. The Import set API allows us to interact with import set table.
195
What is Servicenow Rest API explorer?
ServieNow's REST API explorer is an application to construct and test API requests to a ServiceNow instance. The REST API explorer is available to users with the rest_api_explorer role or admin role.
196
How to trigger Rest Call?
We can write server side script by using below REST API class. sn_ws.RESTMessageV2('rest_message_name','method_name'); Later we can use methods provided by above class to perform further operation.
197
What is scripted rest API?
The scripted REST API feature allows application developers to build custom web service APIs. We can define service endpoints, query parameters, and headers for a scripted REST API, as well as scripts to manage the request and response.
198
What is difference between SOAP and REST?
1. SOAP stands for Simple Object Access protocol whereas REST stands for REpresentational State Transfer. 2. REST has SSL and HTTPS for security, on the other hand SOAP has SSL and WS security due to which in the cases like Bank account password, Card number etc. SOAP is preferred over REST. 3. SOAP allows only XML format REST allows other format as well e.g. JSON, XML. 4.SOAP requires more bandwidth REST requires less bandwidth. 5. Uses the envelope type of messages where message details are secured, REST uses kind of postcard where URI exposes the business logic.
199
How do you test integrations in servicenow?
https://www.servicenow.com/community/developer-blog/how-to-test-integrations-spokes-with-atf/ba-p/2289539
200
How will you setup oauth 2.0 authentication
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0778194
201
Rest API Authenctication Methods
ServiceNow REST APIs use basic authentication, mutual authentication and OAuth to authorize user access to REST APIs/endpoints.
202
What the steps that you follow for OAuth Integration?
https://www.servicenow.com/community/developer-blog/servicenow-sso-integration-sso-implementation-in-servicenow-with/ba-p/2333477
203
What all roles are to be given to the users while performing Inbound and Outbound Rest integration?
Web service access only is the checkbox to prevent login. "ITIL" role is required for integration.
204
What is mutual authentication in Integration? How can I create it?
https://docs.servicenow.com/bundle/washingtondc-platform-security/page/administer/security/concept/c_MutualAuthentication.html
205
difference between 200 and 201 status code
We can handle based on response status code if we get any status code like below 200 Success Success with response body. 201 Created Success with response body
206
When you integrate two systems, how to get the parameters dynamically?
There are two ways to send parameter in integration. 1. You can append parameter in URL, which later can be extracted by other system. Remember that this method is not secure as everyone can see what data you are sending. 2. You can add parameter in request body.
207
What is E bonding?
E- bonding, it means company A and company B are integrated and received an acknowledgment for the same with unique ticket number. Now Company A and Company B can practically transmit the updates and other transactions. Outbound > Company A -----New Submit Request --- > Integration-------> Company B Inbound Company A <-Acknowledgment with Company B Ticket Number--
208
What are the drawbacks of Table API?
They get read/write access to whole table without any restrictions. Therefore it is possibility that if they make any mistake, it could create chaos in whole table. Alternatively we should think of having scripted rest api where SN developer will have more control on what operation other toll can perform. e.g. if other system is only going to change assignment group, adding a comment on incident then instead of providing table api access, you can write scripted rest api.
209
What is the difference between Fix Script and Background Script?
1. We can check progress for Fix Script but not for Background Script. 2. We can kill running fix scripts in between but background script we cannot(Unless we go to Active Transactions via other session and kill it). 3. We can run Fix Script in background but Background script only runs in foreground.Foreground means the current session will be blocked until script execution gets completed, background process means you can keep on working on other stuffs while script runs in background. 4. Background script cannot be run for Scoped Application but Fix Script can be.
209
What is the purpose of setWorkflow() method?
The purpose of setWorkflow method is to enable/disable the running of further business rules that may be triggered by current update.
210
What is difference between initialise and newRecord method while inserting new record?
initialize(): Creates record with empty default field values. newRecord(): creates a GlideRecord, set the default values for the fields and assign a unique id to the record.
211
What is the use of get method in Glide record?
The ‘get’ method is used to return first record in the result set. The ‘get’ method can also be used when you know the sys_id of that record. It returns Boolean values based on the result.
212
How can we update records without updating system fields like Updated, Created, etc. for a particular update?
The autoSysFields is used to disable the update of ‘sys’ fields (Updated, Created, etc.).
213
What is the necessity of script action if we already have script include to write server side script?
Script Actions are executed asynchronously while Script Includes are executed synchronously. If there is scenario where script execution is going to take longer time then it's always better to go with Script Actions as user don't need to wait for script execution completion.
214
How to stop form submission on Client and Server side?
On client side, we can use 'return false'. On server side, we use the function 'current.setAbortAction(true)'.
215
What are the private function in script include and how to define them?
Function names starting with underscore are considered as private functions. These functions can be called only in same script include or extended/inherited script include.
216
What is the difference between getXml() and getXmlWait()?
getXMLWait() is used when you want to halt processing until the results are returned. This will halt everything and wait for it to finish and return the results - getXML() is used when you want processing to continue, even if the results have not been returned
217
GlideQuery vs. GlideRecord:
https://www.servicenow.com/community/developer-blog/glidequery-vs-gliderecord-a-comparison-part-1/ba-p/2267573#:~:text=1.,GlideQuery%20is%20Globally%20scoped.
218
what is GlideFilter API?
The GlideFilter API enables filtering queries to determine if one or more records meet a specified set of requirements. Methods for this API are accessible using the GlideFilter global object. https://www.servicenow.com/community/developer-blog/servicenow-learning-148-do-you-know-what-is-glidefilter-api/ba-p/2783861#:~:text=The%20GlideFilter%20API%20enables%20filtering,using%20the%20GlideFilter%20global%20object.
219
How to copy attachments from one record to another?
You can use glide function. GlideSysAttachment.copy('from table', current.sys_id, 'to table', dmnd.sys_id);
220
What is cleanup scripts?
Cleanup scripts automatically run on the target instance after the cloning process finishes. Use cleanup scripts to modify or remove bad data. Cleanup scripts run after data preservers and the clone are complete.
221
Why we don't use initialize function in scriptinclude while calling it from a client script using GlideAjax
Hi SatyaPriya, The primary use of initialize function in script include is to set default values to variables which can later be used anywhere in script include. We don't need this in client callable script include as the data which we need is normally sent via client script while using GlideAjax. Note :ServiceNow automatically removes initialize function whenever we check client callable checkbox in script include. When a Client Callable Script Include is created the prototype extends from the "AbstractAjaxProcessor" Class and "initialize: function() {}" will not be added since it is already in the AbstractAjaxProcessor.prototype. If we add "initialize: function() {}" into the Client Callable Script Include manually, the GlideAjax call won't work since it overrides the initialize function in the AbstractAjaxProcessor.prototype and request, responseXML, gc objects used in the Ajax call are not available
222
What is reference qualifier? and What are the different types of it?
Reference Qualifier creates filter that restrict the data shown in reference field. There are 3 types of reference qualifiers 1.Simple reference qualifier. 2. Dynamic reference qualifier. 3. Advanced reference qualifier.
223
What is sequence of execution between ACL, business rules, client script, ui policies while form load?
Below is the execution order between BR, ACL, Client Scripts and UI Policies. 1. Before query BR 2. ACLs 3. Display BR 4. On Load Client Scripts 5. On Load checked UI Policies
224
What is sequence of execution between client script, business rules, workflow, notifications when form is submitted?
1. On Submit Client Scripts. 2. Before business rules upto order 1000. 3. Workflows. 4. Before BR's with order greater than or equal to 1000. 5. After Business Rules. 6. E-mail notifications.
225
Difference between gr.next(), gr.hasNext() and gr._next() methods
hasNext() : This method returns true if gr has more records and false when no more record exist. next() : This method returns the next glide record and also moves to the next glide record. _next() : This method is same as that of next() method. However, this is used when table has column with name 'next'.
226
How to allow accessing data from one scoped application to another scoped application?
We can provide access to other application by using Application cross scope access.
227
What is Scoped App and Global App?
Scoped apps are sandboxed from the system at large and utilize a restricted API to minimize/prevent damage to anything outside of their scope. Global apps are everything else, it's the default scope and has access to all parts of the system and therefore can cause damage/impact beyond their intent.
228
What is LDAP Integration and its use?
LDAP is the Lightweight Directory Access Protocol. It is used for user data population and User authentication. Servicenow integrates with LDAP directory to streamline the user login process and to automate the creation of user and assigning them roles.
229
How do we know which version of ServiceNow we are using?
Navigate to "System diagonatics - > Stats" or Type stats.do in left navgitioon and enter.
230
What is a sys_id?
It is a unique 32-character GUID that identifies each record created in each table in ServiceNow.
231
What is HTML sanitizer
For security and usability reasons, only certain HTML tags and attributes are allowed in knowledge base articles. This is enforced by a ServiceNow subsystem called the "HTML Sanitizer". Whenever a knowledge article is saved, the sanitizer scans the HTML and automatically removes anything not allowed.
232
How to publish an application. Explain step by step
https://docs.servicenow.com/bundle/washingtondc-application-development/page/build/custom-application/concept/build-applications.html
233
What is delete and delete multiple
deleteRecord() and deleteMultiple These two method are for the deletion of one or more records from database. you should always make one thing clear in mind that deletion of records in ServiceNow should be always be a rare scenario where deactivation is not an option. Wherever deactivation is option you should go for the same. Non of this function ask for any arguments as both of the record acts on the GlideRecord object. deleteRecord deletes single record wehereas deleteMultiple delete all the records for the passed query You should not use deleteMultiple when your table contains currency field instead you should loop through the records one by one to support deleteRecord(). Performance: The difference is mainly in performance. This has to do with the underlying SQL operations. In SQL, when you want to change a record (including delete operations), the database does some commit checks on every record you make. If you run the operation on multiple records in a sequence, SQL will perform the same commit check but save time only once. So if you need to delete 5-10 records, it doesn't matter, if you need to delete 20000 records, deleteMultiple can save you a lot of time.
234
How will you disable attachment to a specific table
Open a record in the table. Right-click the form header and select Configure > Dictionary. In the list of dictionary entries, select the first record in the list (the record with no Column name entry). Add no_attachment to the Attributes field, separated by commas from any existing attributes. See Dictionary attributes for more information.
235
Difference between dynamic and advanced reference qualifier
https://www.servicenow.com/community/developer-articles/reference-qualifiers-in-servicenow/ta-p/2765175
236
237
What is coalesce?
When we import data into the import set table and then perform transformation of data in the transform maps, we can choose which fields in the import set table will act as unique fields/keys. Using the fields selected as coalesce, when we transfer data into the target table, when records matching the coalesce fields are already present, then the data is updated. Otherwise, new records are created.