What is sweet Alert?

Sweet Alert is a custom dialog library built aiming to replace JavaScript’s “alert” and “prompt” features to provide a fresh and concurrent UI features filled dialogs.

Requirement to integrate

Sweet Alert can be integrated with Service in simple steps. It will work with both UI 15 and UI 16. You need below three codes to integrate it with Service Now.

  • globalsweetalerts –> UI script
  • SweetAlerts-min.js —>UI script
  • SweetAlerts.css –> CSS file.

You can download the update set from Service Now share and import in your instance. If you do not have access to Share Site, Here is the link to download Sweet alert files Sweet Alert.

  • Search for files “SweetAlerts-min.js”, “SweetAlerts.css” and “globalsweetalert” under folder dist.
  • Open above three files in any editor.
  • Create a new UI script with same name to (your wish) i.e. “SweetAlerts-min.js” and paste the content of files in it through list view (as you will get error through form view).
  • Create new stylesheet with same name and paste the content of files in it through list view.

Create a new Global UI script and paste content of file “globalsweetalert”.

How to use Sweet alert

In the client script, instead of alert, now you can write swal() function for alert messages.
E.g., swal(“Hello world!”);

Sweet Alert Configuration with ServiceNow
Sweet Alert Configuration with ServiceNow

Functions of SweetAlert

There are lots of functions we can call. As it is based on java script you can add java script code within it.
E.g.,
swal(“Click on either the button or outside the modal.”)
.then((value) => {
swal(`The returned value is: ${value}`);
});

For more information about function log onto sweet Alert.

Related Posts

  • Journey ITSM Implementation

    Journey: ITSM Implementation

    Journey: ITSM Implementation

    Imagine you're processing an offer for a contract when the [...]

  • ServiceNow Upgrade – Utah Release

    ServiceNow Upgrade – Utah Release

    ServiceNow Upgrade – Utah Release

    ServiceNow releases a new upgrade every 6 months. It is [...]

  • ServiceNow JIRA Integration

    ServiceNow JIRA Integration

    ServiceNow JIRA Integration

    Pre requisites- ServiceNow Instance JIRA Instance Steps: Get ServiceNow Instance [...]

Emergys Blog

Recent Articles

  • Large Language Models

    Verticalization of Large Language Models (LLMs): Unlocking Specialized Potential with Emergys

    Verticalization of Large Language Models (LLMs): Unlocking Specialized Potential with Emergys

    Large Language models (LLMs) have transformed Natural Language Processing [...]

    Large Language models (LLMs) have transformed Natural Language Processing (NLP); however, their generalist nature can [...]

  • Migrating from Remedyforce to BMC Helix

    Enhance Your IT Service Management: Migrating from Remedyforce to BMC Helix

    Enhance Your IT Service Management: Migrating from Remedyforce to BMC Helix

    In today’s rapidly evolving business landscape, organizations must constantly seek [...]

    In today’s rapidly evolving business landscape, organizations must constantly seek ways to optimize their IT service [...]

  • Service Desk Automation

    Top Candidates for Service Desk Automation

    Top Candidates for Service Desk Automation

    Automation is not new to anyone. It is the foundation [...]

    Automation is not new to anyone. It is the foundation for any enterprise digitization. However, companies [...]