We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Pop up or message in Operator Workspace

Victor Sarmento
Tera Contributor

Hello, I'm having a problem and would like some help. For the visualization of the alert in the operator workspace, I would like that when the assigned_to is empty, a pop up appears in the operator workspace informing that no remediation can be taken in case the alert is not assumed. Has anyone ever done something like this? I tried on several fronts and was unsuccessful.

2 REPLIES 2

Amit Gujarathi
Giga Sage

Hi @Victor Sarmento ,
I trust you are doing great.

Create a UI Script:

  • Navigate to "System Definition" -> "UI Scripts" in the ServiceNow application.

  • Click on "New" to create a new UI Script.

  • Provide a name for the script, such as "EmptyAssignedToAlert".

  • In the script field, add the following JavaScript code:

 

function showAlert() {
  var assignedTo = g_form.getValue('assigned_to');
  if (!assignedTo) {
    alert('No remediation can be taken if the alert is not assumed.');
  }
}

 

    • Save the UI Script.

  • Modify the Form:

    • Identify the form where you want to display the pop-up message.

    • Open the form in ServiceNow and navigate to the client script section.

    • Add the following script in the client script section:

 

function onSubmit() {
  showAlert();
  return true;
}

 

  • Save the form.

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Olá, como identificar o formulário no espaço de trabalho do operador para a segunda ação?