Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to clear Info / Error messages in Service Portal

PabloL
Tera Contributor

Hello SNOW community,

 

I have an issue where messages that I display in a custom widget using spUtil.addInfoMessage() sometimes don't clear out automatically, but sometimes they do.

 

I'm looking for a way to force the messages that I displayed to go away after a couple of seconds.

2 REPLIES 2

SK Chand Basha
Tera Sage
Tera Sage

Hi @PabloL 

 

Refer this KB : https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1211106

 

Mark it Helpful and Accept Solution!! If this helps you to understand.

 

 

So I did try to use server side gs.addInfoMessage() combined with gs.flushMessages(), but I'm missing on how to wait a couple of seconds before clearing the messages, because setTimeout was not available from a Service Portal Widget's server script