How to preserve field

ceraulo
Mega Guru

Hello!

 

I am updating an email notification which contains the value of the Description field. When the Description values is in paragraph form, it is displayed as one long string without the new lines in the email.

 

For example:

In the Catalog Task, the Description is:

ramirch_1-1699516079819.png

 

The notification email script for this is:

 

 

 

(function runMailScript(current, template, email, email_action, event) {

	template.print('<span style="font-size: 10pt; font-family: arial;"><strong>' + 'Description: '  + '</strong>' + '<p>' + current.description + '</p></span>');	

})(current, template, email, email_action, event);

 

 

 

 

It is displayed in the email as:

 

Description:

Hello Procurement Team. Please kindly order ThinkVision P44w-10 43.4 Inch 32:10 Ultrawide Curved HDR Monitor . Best regards, SN Guy

 

Is there a way to preserve the formatting of the Description field value in the email notification?

 

Please help.

Thank you.

 

 

 

 

 

 

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@ceraulo 

you might have to detect the new lines and replace them with <br> tags

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