I need an onload popup when user opens Catalog Item

Dawid2
Giga Guru

Hello,

 

When user clicks on the catalog item on the Portal, I need a popup when it's opened that will contain some text, URL to another catalog item and Okay button that will redirect to main Portal page. What would be the best way to achieve this?

5 REPLIES 5

del_ph_in02
Tera Contributor

1️⃣ Create a Variable Set
First, create a variable set in ServiceNow. This will allow you to organize variables, and later assign them to the catalog item where we want the popup to appear.

2️⃣ Add a Custom Variable in the Set
Next, create a variable with a custom type within the variable set. This is essential because we will use this variable to embed a widget that displays our popup.

3️⃣ Create a Message Record
Head over to the sys_ui_message table and create a message record that contains the content you want to display in the popup. You can include text, URLs, and any other dynamic information here.

4️⃣ Create the Widget
create a widget. Use the spModal.open method in the widget’s client script to open the popup.
In the widget's server script, use gs.getMessage to dynamically retrieve the message content from the sys_ui_message table, rather than hardcoding the text.
On the client side, you can access the message content using c.data.