Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Virtual Agent Script Bot response Card Subtitle Rendering as Hyperlink Instead of Plain Text

mohammedghouse
Giga Guru

Hello everyone, 

I'm currently working on rendering a card using Script Bot Response, and I'm facing an issue where the subtitle is appearing as a hyperlink, but I want it to be plain text.

Here’s the snippet I’m using:

 

var card_data = JSON.stringify({
"title": userDetails.fullName,
"subtitle": userDetails.jobTitle + " " + userDetails.layer3,
"fields": fields
});

return vaSystem.renderCard("Card", card_data);
mohammedghouse_1-1751898928790.png

 



Thanks in Advance 

1 ACCEPTED SOLUTION

mohammedghouse
Giga Guru

Hello, 
Got the solution for the above , Instead of "Card"  build  the HTML script and passed it to the below method. 

new sn_cs.SinglePartOutMsg().setHtmlPart()

Thanks Everyone.

View solution in original post

3 REPLIES 3

mohammedghouse
Giga Guru

Hello, 
Got the solution for the above , Instead of "Card"  build  the HTML script and passed it to the below method. 

new sn_cs.SinglePartOutMsg().setHtmlPart()

Thanks Everyone.

...but then you're not rendering a card, you're just rendering whatever HTML you wrote - presumably you tried to replicate the look of a card, but I'm guessing it's not going to look exactly like a card...?

Can you share your code and a screenshot of the output?

Chris D
Mega Sage

I too just came across a use case where I want this subtitle to not be hyperlinked and oddly enough, if you omit a link (or at least what I did was pass an empty string), it makes it a hyperlink to itself: $sn-va-web-client-app.do
So strange.

What I'm going to do in the meanwhile is just link to a static page, like the Portal home or something...