- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 12:22 AM
Hi Team,
My Requirement is:
I have added 4 lines point-wise in acceptance Criteria like below.
But after submission , it's displaying as single line , Like below
Acceptance Criteria Variable type : Multi line Text
What could be the Issue , Please help me.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 12:47 AM - edited 03-28-2025 12:52 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 12:26 AM
Hi @JVINAY
Is the first screenshot from a Catalog item? If yes, then I think it is some expected behaviour of the HMTL field, and it shows in one line.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 12:33 AM
Hi @Dr Atul G- LNG ,
Yes This is Record Producer,
How can I resolve this ?
Can I write Following script in , Record Producer Script section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 12:37 AM
try this if you want each new line to be a separate line in target HTML field
current.accepance_criteria= producer.type_of_request.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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 12:42 AM - edited 03-28-2025 12:48 AM
Hi @Ankur Bawiskar ,
After Adding this line.
Acceptance criteria is Empty. adding text is missing.
Script section Screenshot:
Line no2 script for Description( Multiline Text) filed , its working as Expected , But Acceptance criteria is not working .
Please guide me what changes are to be made to resolve this.