Beginner Help: Understanding Async and Display Business Rules in ServiceNow

mrsahilmir1
Tera Expert

Hi everyone,
I'm currently learning ServiceNow and trying to understand different types of Business Rules. I’ve come across Async Business Rules and Display Business Rules, but I’m a bit confused about how they work and when to use them.

Could someone please help me with:

  • What is an Async Business Rule and when should I use it?
  • What is a Display Business Rule and how is it different from other types?
  • Any simple examples or use cases for both would be really helpful!
Sahil Gani Mir

prerna_sh
Tera Sage

Hi @mrsahilmir1 ,

Async Business Rule:
Async BR are mostly similar to "after business rule", runs after the database commits a change. Unlike after BR, async business rule "run in background simultaneously with other processes." It allows system to return control early but may take longer to update related object.

Display Business Rule:
Executes when a record is queried from the database, before it is sent to the client.

  • Only runs when the record is loaded into a form (not on insert/update/delete).

  • Commonly used to pass data to the client using g_scratchpad.


For Better Understanding go through following:

Business Rule - ServiceNow Community
https://youtu.be/uq9NDPlZywI?si=IlKCMZimkbOoYwpg
https://youtu.be/JFwu0KsYy4w?si=v2_rp6L0nFifeN6P   (The section on async BR starts at 22:00 in the video.)

If my response solves your query, please marked helpful by selecting Accept as Solution and Helpful. Let me know if anything else is required.
Thanks,
Prerna


 

View solution in original post

@prerna_sh  Thank you 

Sahil Gani Mir

Bhimashankar H
Mega Sage

Hi @mrsahilmir1 ,

 

Hope you are doing well in your learning. Here is explanation of BR.

 

An Async Business Rule is a server-side script that runs in the background after a user saves, updates, or deletes a record. Because it runs asynchronously, it doesn't delay the user's interaction; they can continue working immediately after submitting the form. You should use an Async Business Rule for long-running operations that could negatively impact user experience if run in real-time.

 

Common use cases include:

  • Making API calls to external systems (e.g., creating a ticket in Jira).

  • Performing complex calculations or queries that involve many related records.

  • Generating non-critical related records that the user doesn't need to see right away.

  • Sending an email.

 

A Display Business Rule is a server-side script that runs before a record's form is loaded and presented to a user. Its primary purpose is to pass information from the server to the client-side (the user's browser) for use in client scripts.

It's different from other business rules:

  1. Timing: It's the only type that executes before the form is even loaded. Other types (Before, After, Async) run when a user tries to save or submit a form.

  2. Purpose: Its main job isn't to modify the database record but to prepare data for the client. It uses a special global object called g_scratchpad to act as a bridge, sending server-side information to the client. This is far more efficient than using GlideAjax for information needed on form load, as it saves a server round-trip.

This is a perfect two-part job for a Display BR and a Client Script.

 

I would suggest try it on PDI, so that you can get better understanding. Check out this Post which explains step by step and executions.

 

Thanks,
Bhimashankar H

 

-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!

View solution in original post

@Bhimashankar H Thank you.

Sahil Gani Mir