Virtual Agent: Tooltips on links + "Show more" in Script Response Node is it possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello,
We switched from a Text Response Node to a Script Response Node using setHtmlPart() because we needed tooltips on our source links. Standard Markdown tooltip syntax breaks in the Engagement Messenger (URL encoding issue), but <a title="..."> via setHtmlPart works fine.
However we now have following open questions:
1. Markdown tooltip in Text Response Node Is it expected that the standard Markdown tooltip syntax does not work in a Text Response Node within the Engagement Messenger?
[1](https://example.com "Tooltip text")
2. "Show more" / Read more
The OOB "Shorten Response" is only available on Text Response Nodes. Inline JavaScript (onclick) is blocked in the Engagement Messenger. Any workaround?
3. Scroll behavior
The chat always scrolls to the bottom of long responses – the user has to scroll up manually to read from the beginning. Is there any way to control this?
Any insights appreciated!
- Labels:
-
Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hey @ozgurD
Yes what you’re seeing is generally expected behavior with Virtual Agent Engagement Messenger, especially when mixing Markdown, sanitized HTML, and Script Response Nodes.
Here’s a breakdown for each point.
1. Markdown tooltip syntax in Text Response Node
Example:
[1](https://example.com "Tooltip text")
In standard Markdown, the "Tooltip text" becomes the HTML title attribute.
However, in the ServiceNow Engagement Messenger / VA renderer, the Markdown parser and sanitizer do not fully preserve or render the title attribute consistently. In many releases, the tooltip text either:
gets stripped entirely
becomes URL-encoded
or renders inconsistently across channels/devices
So this behavior is generally expected.
Your workaround using:
response.setHtmlPart(
'<a href="https://example.com " title="Tooltip text">1</a>'
);
is currently the most reliable approach.
Important note
Even with setHtmlPart(), the HTML is still sanitized by the messenger framework. Allowed tags/attributes are limited. Fortunately, title on <a> is usually preserved.
2. “Show more” / Read more in Script Response Node
You are correct:
OOB “Shorten response” only exists for Text Response Nodes
Inline JS like:
onclick=""
is blocked/sanitized in Engagement Messenger for security reasons
So there is no true client-side expandable/collapsible HTML solution supported inside VA responses.
Common workarounds
Option A — Split response into multiple messages (recommended)
Instead of one massive response:
vaSystem.sendMessage("Part 1...");
vaSystem.sendMessage("Part 2...");
or use multiple Script/Text nodes.
This is the cleanest supported pattern.
Option B — Simulate “Show more” using buttons/quick replies
Pattern:
- Show shortened summary
- Add a choice/button:
- “Show full details”
- Route to another node containing the long content
This is usually the best UX in Engagement Messenger.
Example flow:
Summary text...
[Show more]
Then next node:
Full detailed response...
Option C — External page/modal
If content is very long:
<a target="_blank" href="kb_article.do?sys_id=...">
Read full article
</a>
This avoids messenger rendering limitations entirely.
3. Auto-scroll to bottom behavior
Unfortunately this is mostly controlled by the Engagement Messenger frontend itself.
By design, the messenger auto-scrolls to the latest message so the user sees the newest response immediately.
Currently there is no supported API in VA scripting to:
- disable auto-scroll
- set scroll position
- scroll to top
- preserve previous scroll offset
especially from:
- Script Response Nodes
- setHtmlPart()
- VA server-side scripting
Practical mitigation strategies
Keep responses shorter
Large single responses create the worst scrolling UX.
Instead:
- chunk content
- paginate logically
- use follow-up prompts
Use cards/buttons instead of huge text blocks
For example:
- “View troubleshooting”
- “View logs”
- “View references”
This reduces long-scroll problems significantly.
Use Knowledge Articles
Instead of embedding everything in chat:
<a href="/kb?id=kb_article_view&sysparm_article=KB0012345">
Open full instructions
</a>
Often the best enterprise UX.
*************************************************************************************************************************************
If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh
Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hey @ozgurD
Hope you are doing well.
Did my previous reply answer your question?
If it was helpful, please mark it as correct ✓ and close the thread . This will help other readers find the solution more easily.
Thankyou & Regards
Vaishali Singh
Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @vaishali231,
Thank you for the detailed explanation that’s very helpful!
I have a follow up question: Is there any way to customize the Markdown renderer in the ServiceNow Engagement Messenger? Or is it possible to configure the HTML sanitizer of the Messenger framework to allow additional tags or attributes?
Best regards,
Özgür