Is it possible to populate an HTML field with a formatted text via client script?

grainer24
Mega Guru

Hello,
I am trying to populate an html field with a text in this format for example:

grainer24_2-1706836921453.png

 

Title:
      description

 

But when i tried to check on the description field it just displays as a single line.
This is my sample script: 

grainer24_1-1706836872345.png

It seems that \n is not working when populated to an HTML field. Do you have any suggestions?

 

Regards,
Vaine

 

1 ACCEPTED SOLUTION

grainer24
Mega Guru

I also found the solution, you just need to find the source code and paste it inside a variable.

This article helped:
https://www.servicenow.com/community/developer-forum/how-to-set-the-format-on-html-field/m-p/1992713

View solution in original post

1 REPLY 1

grainer24
Mega Guru

I also found the solution, you just need to find the source code and paste it inside a variable.

This article helped:
https://www.servicenow.com/community/developer-forum/how-to-set-the-format-on-html-field/m-p/1992713