Can we make text bold in virtual agent options using script

GN
Tera Expert

Hi  I need to make options bold in virtual agent using script. it should display the users in bold 

user 1

user 2

user 3

select Myself

 

Like this

8 REPLIES 8

Hi,

can you share what script you wrote?

If you are using html then you can use <b> bold tag

<b>Select myself</b>

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,
Here is the code.
 
(function execute(table) {
var options = [];
var myself = "Select myself" ;
var my = myself.bold();
var i = 1;
var gr = newGlideRecordSecure('sys_user');
gr.addEncodedQuery('active=true^nameLIKE' + vaInputs.user_name);
gr.query();
if (gr.getRowCount() > 0) {
if (gr.getRowCount() < 10) {
while (gr.next()) {
options.push({ 'value': gr.getUniqueValue(), 'label': gr.getValue('name') });
}
options.push({ 'value': 'for myself', 'label':my});
} else {
while (gr.next()) {
i++;
options.push({ 'value': gr.getUniqueValue(), 'label': gr.getValue('name') });
if (i == 10) {
options.push({ 'value': 'for myself', 'label': my });
} else if (i == 19) {
options.push({ 'value': 'for myself', 'label': my});
} else if (i == 28) {
options.push({ 'value': 'for myself', 'label': my });
} else if (i == (gr.getRowCount() + 1)) {
options.push({ 'value': 'for myself', 'label': my});
}
}
}
}
return options;
})(table)

 

Thanks

nivethika
Tera Contributor

Hi Ankur,

My doubt is consider my sub-item in VA is some troubleshooting steps with url also. while displaying in VA ChatBot that steps some words should be bold to highlight and link should be clickable.

nivethika_0-1686213020114.png

 

How to achieve this. Awaiting for your reply

@nivethika 

can you post a new question for this as this thread is an older one?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader