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.

making text bold with javascript

patricklatella
Mega Sage

hi all,

I've got a piece of script that is putting some text in the work notes on incidents.   How do I get part of the text to show in BOLD?

incident.work_notes = "Transferred from request " + request.number + "\n" + "\n" + request.work_notes.getJournalEntry(-1) + "\n" + "Details from ERP Request" + "\n" + note;

I want the "Details from the ERP Request" to show in bold in the work notes.

thanks!

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Here you go.



incident.work_notes = "Transferred from request " + request.number + "\n" + "\n" + request.work_notes.getJournalEntry(-1) + "\n" + [code]<b>"Details from ERP Request" </b>[/code]+ "\n" + note;


View solution in original post

4 REPLIES 4

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Here you go.



incident.work_notes = "Transferred from request " + request.number + "\n" + "\n" + request.work_notes.getJournalEntry(-1) + "\n" + [code]<b>"Details from ERP Request" </b>[/code]+ "\n" + note;


This answered a totally different question I had--thank you!

patricklatella
Mega Sage

thanks Pradeep!



I actually did this and it worked.



var txt = "[code]<b> Details from ERP Request </b>[/code]";


incident.work_notes = "Transferred from request " + request.number + "\n" + "\n" + request.work_notes.getJournalEntry(-1) + "\n" + txt + "\n" + note;


VerdaKosnett1
Tera Guru

I so hoped this would work in agent workspace but it did not

VerdaKosnett1_0-1722898073949.png