Usecases

-ooo-
Tera Contributor

Question :-

Please explain two use case each one the mentioned in following .

  1. Glide system API along with script.
  2. Glide Aggregate API along with script.
  3. GlideDialogWindow
  4. OnChange() client script Vs. UI policy
  5. Catalog UI Policies
  6. After and async Business Rule.

 

Please Advise. 

1 ACCEPTED SOLUTION

Ratnakar7
Mega Sage
Mega Sage

Hi @-ooo- ,

 

Here are explanations for each of the mentioned use cases:

  1. Glide System API along with script:

    • Use Case 1: Creating a new record programmatically
      • In this use case, you can use Glide System API along with a script to create a new record in a ServiceNow table. You can define the table, set field values, and insert the record using Glide System API methods like GlideRecord and insert().
    • Use Case 2: Querying and updating existing records
      • With Glide System API, you can query and retrieve existing records from ServiceNow tables based on specific conditions. You can also update field values of those records using Glide System API methods like GlideRecord and update().
  2. Glide Aggregate API along with script:

    • Use Case 1: Calculating aggregated values
      • In this use case, you can use Glide Aggregate API along with a script to calculate aggregated values, such as sum, average, maximum, or minimum, from a set of records in a ServiceNow table. Glide Aggregate API provides methods like addAggregate() to define the aggregation criteria and getValue() to retrieve the aggregated value.
    • Use Case 2: Generating reports or statistics
      • Using Glide Aggregate API, you can generate reports or statistics based on specific criteria by aggregating data from multiple records. This can be useful for generating summarized data, performing statistical calculations, or generating charts and graphs.
  3. GlideDialogWindow:

    • Use Case 1: Displaying custom dialog windows
      • GlideDialogWindow allows you to create custom dialog windows in ServiceNow. You can use it to display user-friendly pop-up windows that provide additional information or require user input. These dialog windows can be triggered by buttons, UI actions, or client scripts to enhance the user experience.
    • Use Case 2: Performing data validation or confirmation
      • GlideDialogWindow can be used to perform data validation or confirmation before executing certain actions in ServiceNow. You can display a dialog window with custom messages or validation rules, allowing users to confirm or modify data before saving or proceeding with an operation.
  4. OnChange() client script Vs. UI policy:

    • Use Case 1: Dynamic field behavior
      • OnChange() client script allows you to define JavaScript functions that are triggered when a specific field on a form is modified. This can be useful for implementing dynamic field behavior, such as showing or hiding related fields, populating field values based on other fields, or performing field validations.
      • UI policies, on the other hand, allow you to define field-level behavior without writing code. They provide a declarative way to show or hide fields, set mandatory or read-only states, and control field visibility based on specific conditions. UI policies are useful for implementing simple field behavior without the need for scripting.
  5. Catalog UI Policies:

    • Use Case 1: Controlling catalog item behavior
      • Catalog UI policies allow you to control the behavior and visibility of variables (fields) within a catalog item form. You can define conditions and actions to show or hide variables, set default values, or make fields mandatory based on user selections or other criteria. Catalog UI policies provide a way to customize the user experience and guide users through the catalog ordering process.
    • Use Case 2: Implementing complex form logic
      • Catalog UI policies are particularly useful when implementing complex form logic in catalog items. You can create multiple catalog UI policies with different conditions and actions to handle various scenarios and ensure that the catalog item form dynamically adjusts based on user input or system conditions.
  6. After and async Business Rule:

    • Use Case 1: Data validation and transformation
      • After and async Business Rules are executed after a record is inserted, updated, or deleted in a ServiceNow table. You can use these types of Business Rules to perform data validation and transformation operations, such as checking field values, enforcing business logic, or modifying data before it is saved to the database.
  • Use Case 2: Triggering external integrations or notifications
    • After and async Business Rules can be used to trigger external integrations or send notifications based on specific conditions or events. For example, after a record is created, an after Business Rule can be used to initiate an API call to synchronize data with an external system or send a notification to a user or group.

 

Thanks,

Ratnakar

View solution in original post

1 REPLY 1

Ratnakar7
Mega Sage
Mega Sage

Hi @-ooo- ,

 

Here are explanations for each of the mentioned use cases:

  1. Glide System API along with script:

    • Use Case 1: Creating a new record programmatically
      • In this use case, you can use Glide System API along with a script to create a new record in a ServiceNow table. You can define the table, set field values, and insert the record using Glide System API methods like GlideRecord and insert().
    • Use Case 2: Querying and updating existing records
      • With Glide System API, you can query and retrieve existing records from ServiceNow tables based on specific conditions. You can also update field values of those records using Glide System API methods like GlideRecord and update().
  2. Glide Aggregate API along with script:

    • Use Case 1: Calculating aggregated values
      • In this use case, you can use Glide Aggregate API along with a script to calculate aggregated values, such as sum, average, maximum, or minimum, from a set of records in a ServiceNow table. Glide Aggregate API provides methods like addAggregate() to define the aggregation criteria and getValue() to retrieve the aggregated value.
    • Use Case 2: Generating reports or statistics
      • Using Glide Aggregate API, you can generate reports or statistics based on specific criteria by aggregating data from multiple records. This can be useful for generating summarized data, performing statistical calculations, or generating charts and graphs.
  3. GlideDialogWindow:

    • Use Case 1: Displaying custom dialog windows
      • GlideDialogWindow allows you to create custom dialog windows in ServiceNow. You can use it to display user-friendly pop-up windows that provide additional information or require user input. These dialog windows can be triggered by buttons, UI actions, or client scripts to enhance the user experience.
    • Use Case 2: Performing data validation or confirmation
      • GlideDialogWindow can be used to perform data validation or confirmation before executing certain actions in ServiceNow. You can display a dialog window with custom messages or validation rules, allowing users to confirm or modify data before saving or proceeding with an operation.
  4. OnChange() client script Vs. UI policy:

    • Use Case 1: Dynamic field behavior
      • OnChange() client script allows you to define JavaScript functions that are triggered when a specific field on a form is modified. This can be useful for implementing dynamic field behavior, such as showing or hiding related fields, populating field values based on other fields, or performing field validations.
      • UI policies, on the other hand, allow you to define field-level behavior without writing code. They provide a declarative way to show or hide fields, set mandatory or read-only states, and control field visibility based on specific conditions. UI policies are useful for implementing simple field behavior without the need for scripting.
  5. Catalog UI Policies:

    • Use Case 1: Controlling catalog item behavior
      • Catalog UI policies allow you to control the behavior and visibility of variables (fields) within a catalog item form. You can define conditions and actions to show or hide variables, set default values, or make fields mandatory based on user selections or other criteria. Catalog UI policies provide a way to customize the user experience and guide users through the catalog ordering process.
    • Use Case 2: Implementing complex form logic
      • Catalog UI policies are particularly useful when implementing complex form logic in catalog items. You can create multiple catalog UI policies with different conditions and actions to handle various scenarios and ensure that the catalog item form dynamically adjusts based on user input or system conditions.
  6. After and async Business Rule:

    • Use Case 1: Data validation and transformation
      • After and async Business Rules are executed after a record is inserted, updated, or deleted in a ServiceNow table. You can use these types of Business Rules to perform data validation and transformation operations, such as checking field values, enforcing business logic, or modifying data before it is saved to the database.
  • Use Case 2: Triggering external integrations or notifications
    • After and async Business Rules can be used to trigger external integrations or send notifications based on specific conditions or events. For example, after a record is created, an after Business Rule can be used to initiate an API call to synchronize data with an external system or send a notification to a user or group.

 

Thanks,

Ratnakar