ServiceNow Business Rule Interview Questions 2025

What are Business Rules? What are the different type of Business Rules?

A business rule is a server-side script that runs when a record is displayed, inserted, updated, or deleted, or when a table is queried.

There are 4 type of business rules.
1. Display BR.
2. Before BR.
3. After BR.
4. Asynch BR.

What is the difference between after and asynch BR?

After BR : This type of BR is used when some field changes needs to be reflected immediately after user saves the record. Mostly used to update/insert record into another table once insert/update/delete operation is performed on current record.

Below is an example where After BR can be used
- On reassignment of incident, add comments in associated problem record.

Asynch BR : As name suggest, it runs asynchronously. Whenever Asynch BR is triggered, system creates new entry in event queue to process. Execution time varies for Asynch BR based on the load on event queue.

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.

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.

Display BR configuration details :


Display BR Script :


On Load Client Script :

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.

BR configuration:


BR Script :

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'.

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.

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.

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.

How to trigger notification via Business Rules?

We can use gs.eventQueue method to trigger notification via business rule.
Syntax : gs.eventQueue('event_name',current,'param1','param2');

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.

Assignment for you:

1. Which type of BR shouldn't include current.update() and why?

2. Explain advantages of Asynch BR over After BR or vice versa.

3. Can we call scheduled job from BR?

4. Did you ever called script include in BR? Why we call script include in BR if we can write same script in BR itself?

Real Time Sample Questions:

1. How do you debug BR? What are the different ways to debug BR?

2. Explain any scenario where we can't use Asynch BR?

3. Explain any scenario where we can use Display BR instead of using GlideAjax?


Prepared and confident for your interview?

Practice makes perfect! Test your skills with our virtual interview practice buddy and ensure you're fully ready for your upcoming interview.

🎯 Start Practicing

User Added Interview Question and Answers

sourav 2025-07-31 01:29:14

business rule to create a ctask under a change request when that change request is created via recorrd producer

0 Helpfuls


Harika 2024-12-21 08:27:31

Sir, I am confused about when to use before, after, async business rule? I know what they are and how they work but it seems like what can be done with before can also be done with after, so what's the point of them and next question is if in async business rule there is no current and previous then how we can access the current record while using async business rule? and where should we use trycatch


Sudden_Handle 2025-12-27 07:58:23
I had the same confusion when I first started learning Business Rules. The difference between Before, After, and Async becomes clearer when you think in terms of when the record is saved and what you are trying to update. I’ll explain this using simple scenarios so you can analyze and decide which type fits your use case. Before Business Rule A Before BR runs just before the record is written to the database. At this stage, the record is already prepared for saving, so you should not use current.update() here. Use a Before BR when you want to: Modify fields on the same record Inject or adjust values right before the save happens Examples: Automatically populate the Closed by field when the state is set to Closed, without requiring the user to fill it manually. (Example) If Priority = Critical, automatically update Urgency. In these cases, you’re simply setting additional field values on the current record that’s about to be saved. After Business Rule An After BR runs only after the record has been successfully saved to the database. This is important when your logic depends on the record actually being committed. Use an After BR when you need to: Update other tables Update related records Ensure all mandatory fields are satisfied and the save is successful Examples: When an Incident is Resolved, add a work note to the related Problem record. Although you could technically check current.state == 'Resolved' in a Before BR, if the record fails to save due to a missing mandatory field, the Problem record would still get updated. Using an After BR prevents this issue. When an Incident is Closed, automatically close all its child Incidents. If you use an After BR to update the same record, you would need to call current.update(), which is generally not recommended and should be avoided when a Before BR can do the job. Async Business Rule An Async BR runs after the transaction completes, at a later point in time, without making the user wait. Use Async BRs for: Background processing Actions that don’t require immediate user feedback Examples: Sending notification emails, Generating reports, Updating data that doesn’t depend on user interaction In Async BRs: The current object is available The previous object is not available This is because multiple updates may have already occurred by the time the Async BR executes, making the previous state unreliable. Display Business Rule A Display BR is typically used to pass server-side data to the client using the g_scratchpad object. This data can then be accessed in: Client Scripts, UI Policies, onChange and onSubmit Client Scripts Try/Catch Usage try/catch is standard JavaScript error handling and can be used in Business Rules when: You’re unsure if data exists, There’s a possibility of unexpected data or validation issues Using try/catch helps: Prevent script failures, Ensure smoother execution, Make debugging easier without breaking other scripts Please add anything if I misunderstood.
0 Helpfuls
0 Helpfuls


Sonu 2024-09-09 03:13:29

What is the backend process in service catalog?


tarun teja 2025-03-26 11:08:05
In ServiceNow, the backend process for the Service Catalog involves defining and managing catalog items, their workflows, and the fulfillment processes that occur when a user requests an item, including creating records, assigning tasks, and triggering approvals
0 Helpfuls
0 Helpfuls


Keerthana Arumugam 2024-05-21 07:49:35

How to call business rules from scheduled job


Anil 2024-07-07 02:36:25
you can write BR name in job context , use below syntax JOB CONTEXT: fcScriptName=Business_rule_name
0 Helpfuls
0 Helpfuls


Lakshmi 2024-03-20 08:19:32

What is order of running the rules like which rule runs first business rules ,second Ui policy and so on


Pradeep 2024-04-03 02:47:50
This is my understanding, Query BR -> Display BR -> On Load CS -> On Load UI Policy -> On Change CS -> UI Policy -> Before BR -> After BR -> Asycnh BR
0 Helpfuls
1 Helpfuls


ram 2024-01-29 00:13:51

how to call script include in business rules?


KUSHAL TM 2024-02-02 12:41:24
for example, write below code in your BR. var scrptInc=new yourScriptIncludeName(); scrptInc.functionNameOfYourScriptInclude();
1 Helpfuls
GVK 2025-09-08 07:15:38
method 2 : new scriptIncludeName().myFunction();
0 Helpfuls
0 Helpfuls


Mounika 2023-11-16 06:58:34

how to call an event through business rule?


Anonymous 2023-11-17 09:16:04
gs.eventQueue('event name',current,parm1,parm2);
2 Helpfuls
0 Helpfuls


Supritha 2023-11-15 09:08:43

What is GlideRecordSecure? What is the difference between GlideRecord and GlideRecordSecure: Answer: GlideRecordSecure is a version of GlideRecord that provides an additional layer of security. GlideRecordSecure is designed to prevent unauthorized access to data. GlideRecordSecure enforces access controls and ensures that the user has permission to access the records they are querying. Developers can then use GlideRecordSecure in the same way as GlideRecord to query and manipulate ServiceNow records. GlideRecord queries and manipulates data in the same way as GlideRecordSecure, but GlideRecordSecure provides additional features for securing sensitive data. This ensures that sensitive data cannot be intercepted by unauthorized users as it enforces access controls. Another difference between the two is performance, Because GlideRecordSecure enforces access controls, it may take longer to execute queries than GlideRecord.

4 Helpfuls


Urmila Mukati 2023-11-05 01:47:17

Interviewer asked me why we use async BR to trigger notification instead of this we can also trigger notification by it's condition itself. Why we need BR can someone please answer?


Venkat 2024-10-10 04:14:48
Business Rule: With an async Business Rule, you can implement complex logic and conditions that may be difficult or impossible to achieve using the standard notification condition builder. This gives you greater flexibility to decide when and how the notification should be triggered. Example: If the notification depends on a combination of factors or involves checking multiple related records, this can be handled in a Business Rule more easily than using notification conditions alone.
0 Helpfuls
0 Helpfuls


Saidulu Yadav 2023-08-25 07:27:22

what is main difference between UI Policy and Client Scripts.


William 2023-10-06 11:26:00
- 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.
0 Helpfuls
Arpan 2023-10-16 18:59:04
UI Policies can be run for a specific view if you uncheck the Global field and then enter the view name you need.
1 Helpfuls
Surendra 2023-10-23 22:44:55
Hi William We can execute client script or UI policy for the specific view as well.
0 Helpfuls
2 Helpfuls


Ranjit 2023-08-07 20:05:22

Whether the g_scarthpad can be used on all the types of client script?


Naveen 2023-08-19 01:03:09
g_scratchpad is used only in Onload Client scripts to get the data from Display business rule.
1 Helpfuls
Roshan 2023-08-24 08:05:47
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.
0 Helpfuls
0 Helpfuls


Ann 2023-06-07 21:56:59

Hi How to autoclose REQ and RITM when task is closed.


Saba Anjum 2023-07-01 06:59:58
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();
0 Helpfuls
0 Helpfuls


annin 2023-05-09 05:03:18

Hi I have asked a question when the incident state is closed related problem state should also be closed How can we do this


Gaurav 2023-05-10 06:38:33
We 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)
0 Helpfuls
0 Helpfuls


kiran 2023-04-28 09:09:28

How to trouble shoot if user is not able to login?


Pratiksha 2023-05-04 22:08:16
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.
0 Helpfuls
Astik 2023-12-09 14:23:15
If user is not able to login please check below things 1.User is active 2.user id is not empty 3.Most Important - User is not locked out
1 Helpfuls
0 Helpfuls


Anoynymous 2023-04-17 01:47:29

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?


Anubhav 2023-04-17 21:56:16
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.
3 Helpfuls
2 Helpfuls


Rishikesh 2023-03-30 04:52:48

Why current.update() in before BR doesn't create recursion call to same BR infinitely?


Akanksha 2023-03-30 05:35:40
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. Source : https://support.servicenow.com/kb?id=kb_article_view
0 Helpfuls
0 Helpfuls


Riddhi 2023-03-29 06:25:54

I was given a scenario where I said, I can use after BR to achieve it. But, he asked me why After BR? why not before or Asynch BR? I was not able to justify my answer. Can somebody explain what should be the proper answer to this question? this was asked two times to me for different scenario.


Akanksha 2023-03-30 04:39:12
I think answer depends on given scenario. However, below are the short and simple use cases for different BR. Before BR : Use this BR when you want to update anything on current record. If you use After or Asycnh BR for such scenario then you will have to use current.update() which is not considered as best practice. Asynch BR : When you want to perform any operation which takes long time to execute. This way, user don't have to wait for this BR to complete as it runs in backend asynchronously. After BR : When you want to perform any operation on other than current record, it could be record in other table or same table but other than current record. Hope this helps.
0 Helpfuls
Priyanka 2025-07-23 05:44:02
Before Business Rule: A Before BR runs before the record is saved to the database. It’s best for scenarios where I want to validate or modify data on the current record. However, it’s not ideal when I need to create related records or trigger flows, because the current record’s sys_id isn’t guaranteed to exist yet. Relying on it too early could cause data integrity issues or trigger failures. Async Business Rule: An Async BR executes after the record is committed, but runs in the background. It is faster in terms of not blocking the main transaction, so it’s useful for non-critical operations like logging, notifications, or calling external systems. But for flows and catalog requests that require sequential execution or guaranteed timing, async rules can introduce risks, since they have no guaranteed execution time or order. It may delay or fail silently, which is unacceptable for time-sensitive tasks. After Business Rule: An After BR runs immediately after the record is saved and within the same transaction. This makes it ideal for creating dependent records, updating related tables, or triggering flows that rely on data that is now committed, including the sys_id. It ensures that everything runs in a reliable sequence and within a guaranteed time frame. In catalog requests or flow orchestration, this level of control is critical, so After BR becomes the best fit.
1 Helpfuls
0 Helpfuls






🚀 Power Up Your ServiceNow Career

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

Fuel My Passion

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


Buy Me a Coffee

Support with UPI

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

UPI QR Code

Comments

Rahul 2024-10-16 00:44:30
Sir, I am confused about when to use before, after, async business rule? I know what they are and how they work but it seems like what can be done with before can also be done with after, so what's the point of them and next question is if in async business rule there is no current and previous then how we can access the current record while using async business rule? and where should we use trycatch