How to add new line in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 01:09 AM - edited 02-09-2024 01:10 AM
Tried "\n" thing but not working out.
I need description should be look like ,
Description from group: answer
descValue
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
//Need to add new line in below line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 01:18 AM
Practically it should work
g_form.setValue('comments', exp_id + '\n' + model_name + '\n'+ desc );
https://www.servicenow.com/community/developer-forum/how-to-break-line-in-setvalue/m-p/2355518
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
02-09-2024 01:19 AM
Hi @priyankagavali
In my case, it is working as expected, this is how we break the line in CS.
Could you please share how you're getting the value in the description field?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 01:26 AM
Getting like this,
Description from group:testanswer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 01:32 AM
@priyankagavali
I am believing the description field is the multiline text right that we usually have OOTB.