The CreatorCon Call for Content is officially open! Get started here.

After form submitting single line value displayed instead of multiple lines text

JVINAY
Tera Contributor

Hi Team,

My Requirement is:

I have added 4 lines point-wise in acceptance Criteria like below.

JVINAY_0-1743146234378.png

But after submission , it's displaying as single line , Like below

 

JVINAY_2-1743146392227.png

Acceptance Criteria Variable type : Multi line Text

What could be the Issue , Please help me.

Thank you.

 

 

1 ACCEPTED SOLUTION

Robert H
Mega Sage

Hello @JVINAY ,

If possible, just change the type of the "Acceptance Criteria" variable from Multi Line Text to HTML.

Else you would have to add a script like this to the Record Producer:

current.acceptance_criteria = producer.getValue('acceptance_criteria').replace(/\n/g, '<br>');

 Note: not sure if the "accepance_criteria" in your post is just a typo. In my example I have spelled it as "acceptance_criteria".

Regards,

Robert

View solution in original post

7 REPLIES 7

@JVINAY 

acceptance criteria is of type HTML in target table

Acceptance criteria in record producer is multi-line. what's the variable name for it?

try this

current.accepance_criteria= producer.type_of_request + "<br/>" + producer.accepance_criteria.replace(/(?:\r\n|\r|\n)/g, '<br/>');

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Robert H
Mega Sage

Hello @JVINAY ,

If possible, just change the type of the "Acceptance Criteria" variable from Multi Line Text to HTML.

Else you would have to add a script like this to the Record Producer:

current.acceptance_criteria = producer.getValue('acceptance_criteria').replace(/\n/g, '<br>');

 Note: not sure if the "accepance_criteria" in your post is just a typo. In my example I have spelled it as "acceptance_criteria".

Regards,

Robert

JVINAY
Tera Contributor

Hi @Robert H ,

Thank you for your Reply it's working.