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

Hi Beth,



Thank you, this is exactly what I was looking for.



Much appreciated!



Vlad


I'm glad it helped. It's worth noting that, as Akash mentions above, you probably want an OnSubmit function, not an OnLoad one! You can tell I've spent all day scripting when I can't keep something like that straight.



Good luck in your own scripting adventures!


Hey Beth,



I have one follow up question relating to this alert stuff.



Is there any way to create a message like this to appear within the Service Catalog?



So for example, rather than having the alert appear on the item itself, what about when a user opens up the catalog and navigates to a particular Category?



I only ask because rather than adding this client action code to each item, which is a bit inefficient, is there a way to add it to the category as a whole?


If not, what would you suggest is the best way to create this alert and then apply it to multiple service catalog items globally?



Thank you!


Here you're getting into areas that I don't have a lot of experience with; we use the CMS, so I'm not sure that your experiences will be the same.



I almost hesitate to give a solution to this question. I don't know of an out-of-the-box way to do this, but I could speculate with all of my 'vast' experience on ways that you could make it happen. I'm also making some assumptions, since I'm not certain why you would need to do this.



The most obvious answer is "put the information in the category description" but I'm going to assume that isn't aggressive enough to grab user attention.



Use a variable set.


    • If this were a piece of information you needed to make sure that every customer saw for every item in the category, you could use a variable set. We've used something similar with our mobile devices; there is some basic disclaimer information common to every mobile device.

      To make this as simple as possible, we built a variable set. Then we added an HTML variable with the default information being what we wanted to tell the users every time. We made the field read only, but you could easily add some scripts and other logic if you wanted, for example, to force the user to acknowledge that they had read, or something similar.

      For every item we made in that category, we included this variable set. Now every mobile device provides the disclaimer information.

      Pro:
      Variable sets are super powerful, and are probably the best way to tell the user the same thing over and over again (that we've uncovered.)

      Con:
      This will be at the item level, not the listing of items as you requested.



Use an order guide.


    • If you're trying to talk to the user when they enter a category as a means of guiding them, you could potentially use an order guide. I haven't used these extensively, but they seem very powerful and a good way to 'gate' users down to a particular item (or set of items.)



Another, potentially very bad ways of doing this might include (if you are using the CMS) using a content block to serve up some javascript. This would be a huge pain to maintain in the long run.



Sorry I don't have a solid answer for you. If you can spell out the motivation for your requirements, I might be able to help a little more.




You might also consider making this a new question; that's going to get more attention from the community at large. Good luck!


Hey Beth,



Thank you for taking the time to provide such an in depth response.



The main reasoning behind why we wish to do this is because we want to alert users that for certain items that can be ordered within the Catalog, more expensive items will require manager approval.


I figured its easier to place that "alert" on the category rather than per each individual item.. for example, any item within the "Laptop" category would require approval, so it would be easier to have the alert display when the user navigates to that category, rather than to add the scripting to each individual item.