Types of business rules with example.

Newbee4
Kilo Contributor

I have just started learning servicenow. Need help with few questions. Can anyone explain business rules with example.

1 ACCEPTED SOLUTION

Shubham Tipnis
Kilo Sage
Kilo Sage

Hi,

Since you are new to servicenow, I would suggest you to go through the trainings at developer.servicenow.com along with servicenow documentations to get a clearer picture of all the concepts.


As for the business rules,

Display Business Rule in ServiceNow:
Code written in display business rule get executed before the form is presented to the user and just after the data is read from the database.

For e.g. you have written the code that when xyz user click on information box then only data related to that user specific country will get displayed to user. It means that user from US can see US specific data and user from India can see India specific data.


Before Business Rule in ServiceNow:
Code written in before business rule get executed when user submits the form and data is not saved in database.
Let’s say User click on submit button --> Before business rule code executes --> information will save in database.

For e.g. Let’s say you have written the code that when user click on submit button then some extra information which in not filled by user such as user current location, user manager name and user past activities will get save when user click on submit button.

After Business Rule in ServiceNow:
Code written in after business rule get executed when user submits the form and data saved in database.
Let’s say User click on submit button --> data saved in database --> Now after business rule code get executed.

For e.g. there is parent incident and child incident and you want that related child incident will get closed automatically after the parent incident get closed by user.


Async Business Rule in ServiceNow:
Async business rules are like after business rule but it runs in the background simultaneously with other processes. Means async business rule run after the data is saved into the database.
Running on background means that use can proceed with other functionality and code will run on the background which will not impact the user while doing other transitions.

For e.g. Incident ticket is in pending customer action status and will be auto closed after 5 days if user did not provide any update on incident ticket.

 

TypeUse case
displayUse to provide client-side scripts access to server-side data.
beforeUse to update information on the current object. For example, a business rule containing current.state=3; would set the State field on the current record to the state with a value of 3.
afterUse to update information on related objects that need to be displayed immediately, such as GlideRecord queries.
asyncUse to update information on related objects that do not need to be displayed immediately, such as calculating metrics and SLAs.

 


Please mark correct/helpful if applicable.

Regards,
Shubham

Regards,
Shubham Tipnis
 ServiceNow Enthusiast
️ 3x Rising Star (2022–2024) – ServiceNow Community
 Sharing insights, use cases & real-world learnings from the Now Platform
 Always learning. Always building.

View solution in original post

8 REPLIES 8

Shubham Tipnis
Kilo Sage
Kilo Sage

Hi,

Since you are new to servicenow, I would suggest you to go through the trainings at developer.servicenow.com along with servicenow documentations to get a clearer picture of all the concepts.


As for the business rules,

Display Business Rule in ServiceNow:
Code written in display business rule get executed before the form is presented to the user and just after the data is read from the database.

For e.g. you have written the code that when xyz user click on information box then only data related to that user specific country will get displayed to user. It means that user from US can see US specific data and user from India can see India specific data.


Before Business Rule in ServiceNow:
Code written in before business rule get executed when user submits the form and data is not saved in database.
Let’s say User click on submit button --> Before business rule code executes --> information will save in database.

For e.g. Let’s say you have written the code that when user click on submit button then some extra information which in not filled by user such as user current location, user manager name and user past activities will get save when user click on submit button.

After Business Rule in ServiceNow:
Code written in after business rule get executed when user submits the form and data saved in database.
Let’s say User click on submit button --> data saved in database --> Now after business rule code get executed.

For e.g. there is parent incident and child incident and you want that related child incident will get closed automatically after the parent incident get closed by user.


Async Business Rule in ServiceNow:
Async business rules are like after business rule but it runs in the background simultaneously with other processes. Means async business rule run after the data is saved into the database.
Running on background means that use can proceed with other functionality and code will run on the background which will not impact the user while doing other transitions.

For e.g. Incident ticket is in pending customer action status and will be auto closed after 5 days if user did not provide any update on incident ticket.

 

TypeUse case
displayUse to provide client-side scripts access to server-side data.
beforeUse to update information on the current object. For example, a business rule containing current.state=3; would set the State field on the current record to the state with a value of 3.
afterUse to update information on related objects that need to be displayed immediately, such as GlideRecord queries.
asyncUse to update information on related objects that do not need to be displayed immediately, such as calculating metrics and SLAs.

 


Please mark correct/helpful if applicable.

Regards,
Shubham

Regards,
Shubham Tipnis
 ServiceNow Enthusiast
️ 3x Rising Star (2022–2024) – ServiceNow Community
 Sharing insights, use cases & real-world learnings from the Now Platform
 Always learning. Always building.

Love to see your explanation....

Thank you @Litu05! It's good to know that the explanation helped you.

Regards,
Shubham Tipnis
 ServiceNow Enthusiast
️ 3x Rising Star (2022–2024) – ServiceNow Community
 Sharing insights, use cases & real-world learnings from the Now Platform
 Always learning. Always building.

Very important information!

 

When evaluating furniture brands, it's crucial to understand customer experiences. The worst furniture brands can often have issues with durability or poor customer service, so it's good to know which ones to avoid. I recently came across some useful discussions around business rules and practices, particularly on how service management impacts customer satisfaction. If you're interested in learning how business systems and customer feedback systems intersect, you can dive deeper into areas like ServiceNow. It provides insightful business rule examples that may inspire better decision-making across various industries.