The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Create an alert in Service Catalog

Vlad_Rozic
Kilo Contributor

Hello,

I am trying to identify how to create a script that will allow for us to get a pop up message when a user means to submit a ticket to request for a particular item or items in the catalog.

For example, if they were to go in and request for a phone, is there a way to make it so that prior to submission or even on page load, they will be prompted with a message that states "this phone is blah blah blah" whatever message we wish?

I have found several solutions online but they do not deal with the Service Catalog, so I'm wondering how to achieve this? Is it a client script? Business rule?

We'd like to make it so that it could be applied to only certain catagories of items.

Thank you for any suggestions!

1 ACCEPTED SOLUTION

Hi there!



The one you're probably looking for if you want a popup is alert. A very basic OnLoad script that would show an alert could be as simple as:





function onLoad() {


  alert('Hi there! I'm an alert message!');


}





This line would go into the script area of a (catalog) client script. You could associate the script with either a catalog item, or a variable set. Be sure to set the "OnLoad" type for the client script.





More details can be on scripts here:


And on UI messages here:


Or here, which is the best reference I have found for the various alerts, popups, and messages available on the service now UI:



If you really want to get fancy, this article is something I'm currently looking into:



Hope that helps.


View solution in original post

10 REPLIES 10

Artemis15
Kilo Guru

Hi Vlad,



You can create a onSubmit catalog client script having specific conditions.



Let me know in case of any other help.


-


Cheers,


Akash


I see.. would there be somewhere I could get an example of a script that may work for this?



I'm very green with scripting and haven't done much at all in SN up to this point.


If you know how to write client script on form than catalog one is also similar.


If you dn't know, then i suggest you that go for forms first.



-


Cheers,


Akash


Hi there!



The one you're probably looking for if you want a popup is alert. A very basic OnLoad script that would show an alert could be as simple as:





function onLoad() {


  alert('Hi there! I'm an alert message!');


}





This line would go into the script area of a (catalog) client script. You could associate the script with either a catalog item, or a variable set. Be sure to set the "OnLoad" type for the client script.





More details can be on scripts here:


And on UI messages here:


Or here, which is the best reference I have found for the various alerts, popups, and messages available on the service now UI:



If you really want to get fancy, this article is something I'm currently looking into:



Hope that helps.