Map values from string field to html type field with out loosing format.

Ben42
Tera Contributor

Hello Experts,

I have record producer with a "multi line" text field (string)  that is mapped to html type field on record. But, when record is submitted the format given in multi line text field at the time of submission is lost/messed. 

EX: Multi line text field has below input

1. Hello ServiceNow

2. Record producer description

The html type field is displayed in below format.

1. Hello ServiceNow 2. Record producer description

How can I retain the format that is provided at the time of submitting the record producer?

 

Thanks,

Ben.

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, a simple fix would be to utilize a script that parses your string and replaces the string formatting with suitable HTML tags.

If you just want the values on new lines then a simple replace might be sufficient, so depending on the string end of line char(s) something like  yourString.replace('\n', '<br>');
If you are looking for more formatted HTML then you will need to build this around your string.

Without clear details of exactly what you are doing where and how, you may also need to prefix\suffix your updated string with [code] [/code] so that it is seen as HTML by the platform.

Render journal field entries as HTML (servicenow.com)