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.

Make return value in bold while Generating to PDF

Pooja P
Tera Contributor

Hi Team,

 

We have requirement to make return dynamic value (date )in bold , when using generate PDF document.

example 

 var newDateString = 'the ' + dayWithSuffix + " day of " + fullMonthName + " " + year + '.';
return newDateString;
 
So return value of newDateString must be in bold. Tried with .bold() not working Kindly help.
5 REPLIES 5

briannice
Kilo Sage

Hello @Pooja P 

 

You can maybe try to wrap the text in html bold-tags:

 

var newDateString = '<b>the ' + dayWithSuffix + " day of " + fullMonthName + " " + year + '.</b>';

 

Let me know if this works!

 

Kr Brian

Shruti
Mega Sage
Mega Sage

 var newDateString'the ' + dayWithSuffix + " day of " + fullMonthName + " " + year + '.';

newDateString = '<p style="text-align: left;"><strong>' + newDateString + '</strong></p>';

return newDateString;

Ankur Bawiskar
Tera Patron
Tera Patron

@Pooja P 

you can use the <b> tag

var newDateString = 'the ' + dayWithSuffix + " day of " + fullMonthName + " " + year + '.';
return  '<b>'+newDateString+'</b>';

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Pooja P
Tera Contributor

Hi Everyone , i tried all the methods mentioned above its not helping below is the example where i am getting the return value instead of Bold.

<b>the 31ˢᵗ day of January 2025.</b>