Ho to break line (new line) from a string.

sinu2
Tera Expert

Hi All,

 

I have one string where i stored glide record information like this Name1:Value1,Name2:Value2,Name3:Value3,Name4:Value4 . But here the client gets more confusion like that so that i want

 Name1:Value1,

Name2:Value2,

Name3:Value3,

Name4:Value4

Please find the below script which i wrote.

state_report= sr.u_productnumber+ ':' +sr.u_hpprodfamily+  ','  +state_report;

 

Can anyone help on this.

1 ACCEPTED SOLUTION

Hi,

Use below script; instead of \n I have used two spaces

state_report= sr.u_productnumber+ ':' +sr.u_hpprodfamily+  ','  + '  ' + state_report;

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

11 REPLIES 11

Please raise a new question if you want this one answered.

Thanks,

Paul


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Soeren Ravnhold
Tera Contributor

Hi thank you for all your comments.

I just succeeded adding a linebreak and new information to a String field using this code.

 

parentRecord.u_question = parentRecord.u_question + '\n' + 'Debitor - Jura: ' + debitorJura.number.toString() + ' oprettet';