Can I Seperate in a Multi Line Text from a String

Walter Toney
Tera Expert

good day,

 

I have been asked if we can separate a bunch of emails in a multi line text field that is being populated and has potential to grow.

 

details:

 

i have a table that has a field that captures emails of people in a string field. i cant cut and paste it here due to the emails addresses but it looks something like this

 

1@hotmail.com,2@hotmailq.com1@hotmail.com,2@hotmailq.com1@hotmail.com,2@hotmailq.com1@hotmail.com,2@hotmailq.com1@hotmail.com,2@hotmailq.com1@hotmail.com,2@hotmailq.com1@hotmail.com,2@hotmailq.com1@hotmail.com,2@hotmailq.com1@hotmail.com,2@hotmailq.com1@hotmail.com,2@hotmailq.com

 

now that data from that String field is being pushed by a script include to a Service Catalog Request to a Multi line Text field and looks the same as above, Our client wants to know if their a way to make it look neater. like this

 

1@hotmail.com,

2@hotmailq.com,

1o@hotmail.com,

13@hotmail.com,

22@hotmailq.com,

17@hotmail.com,

 

and make all additions that will happen in the future look like that as well

 

I tried this in the script include (this is the line where it's pushing the data) but it did not work

 

hrCEINFO.poc_distro_list = hrCERecord.poc_distro.toString() + "\n" + hrCERecord.poc_distro.toString();

 

 

1 REPLY 1

Anil Lande
Kilo Patron

Hi,

You can use it like below:

var emailArr=  hrCERecord.poc_distro.toString().split(',');
var newList = emailArr.join('\n');
hrCEINFO.poc_distro_list = newList;

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande