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) => );

For more information about function log onto sweet Alert.

Explore More on ServiceNow

  • VIDEO

    Elevating Your ServiceNow Experience with Managed Services

  • eBOOK

    Efficiency and Excellence: ServiceNow Managed Services with Emergys

  • WEBINAR

    From Potential to Performance: Unraveling the Power of ServiceNow

  • BROCHURE

    Emergys – Your Trusted Digital Transformation Partner

Subscribe to our Newsletter

Subscribe to our Newsletter

Access new insights, employee stories, case studies and other activities going on in the Emergys enterprise