What It Does
The addInfoMessage() method queues a blue informational message to display at the top of the user's form after the current server-side execution context completes. ServiceNow stores these messages in the user's session and renders them on the next page load or form refresh.
Internally, ServiceNow adds the message to a temporary collection tied to the current user session. When the browser renders the next page, the platform injects these messages into the DOM as styled notification banners. The messages are consumed during display, meaning they only appear once and are automatically cleared.
The method returns void and never throws errors, even when passed invalid parameters. Empty strings, null values, or undefined parameters simply result in no message being displayed. HTML content is automatically escaped, so raw HTML tags appear as literal text rather than being rendered.
Messages only appear for synchronous page loads and form submissions. AJAX operations, REST API calls, and asynchronous updates don't trigger message display. The timing is crucial: messages queued in before Business Rules appear after the record saves, while messages in after Business Rules appear immediately when the form reloads.
This method belongs to the broader GlideSystem message family, alongside addErrorMessage() for red error banners and addMessage() for generic notifications. All three methods queue messages identically but render with different visual styling.
When to Use This
Use addInfoMessage() when you need to provide informational feedback about successful operations, data processing results, or status updates that users should know about but don't represent errors. Perfect for confirming that automated processes completed, notifying about data synchronization, or explaining why certain fields were auto-populated.
Choose addErrorMessage() instead when validation fails or operations encounter problems. Use gs.log() for technical details that only administrators need to see. Avoid using info messages for debugging output or verbose system information that clutters the user interface.
Don't use addInfoMessage() in Script Includes called by AJAX or in REST API endpoints. The messages won't display since there's no form to render them on.
Return Value
The method returns void (undefined in JavaScript terms) and provides no indication of success or failure. There's no way to programmatically verify that the message was queued or will display to the user. The method executes silently regardless of parameter validity.
Since the return value is meaningless, never attempt to chain method calls or use the result in conditional logic. The method's effect is purely side-based, modifying the user's session state for the next page render.
Enjoying this? Get one deep-dive per week.
Join 1,000+ ServiceNow pros — scripts, GlideRecord patterns, Flow Designer techniques, and career moves. Free.
Platform Behavior & Side Effects
- No Business Rules, ACLs, or workflows are triggered by adding messages
- Nothing is written to the database; messages exist only in server memory until consumed
- Extremely fast performance with no database overhead or network latency
- Messages are session-scoped and never visible to other users
- Works identically in before and after Business Rules, but timing of display differs
- Multiple calls accumulate messages; all queued messages display simultaneously
- Messages automatically clear after display and don't persist across user sessions