We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

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

Not applicable

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
Giga 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

@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  ||  10x 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>