How to fetch carriage return values and parse in script include

Nikithesh R
Tera Contributor

Hello,

 

I have a functionality in Service Portal for particular catalog item. When RITM is raised and from Actions UI button configured another UI button as Submit again. 

It is designed to copy values from existing RITM to create a new RITM with existing values copied. It is copied using script include and catalog Onload client script.

I have MRVS used for the catalog item, when values are fetched from Multi line text variable to a new request it is throwing error in browser console. The issue when line breaking statements entered in multi line text variable it is unable to copy to new request.

Can anyone help me on the script how to fetch line breaking statements from multi line text variable and copy to another multi line text variable?

 

Thanks in advance.

9 REPLIES 9

Dnyaneshwaree
Mega Sage

Hello @Nikithesh R ,

Please check that the property 'glide.ui.escape_all_script' is true .

Dnyaneshwaree_0-1718025843098.png

Please accept my solution if it works for you and thumps up to mark it as helpful.

Thank you!!



Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!

Dnyaneshwaree Satpute
Tera Guru

Hi @Dnyaneshwaree,

Thanks for the response. Yes the system property is active. Checked already.

 

Community Alums
Not applicable

Hi @Nikithesh R ,

 

The issue you are facing for the line breaks should be handled properly during the copy process. Please revisit the scripts that you have.

Can you please share the script include and client script if any so that we can take a look once.

 

Take a look into the solution posted in this link-

https://www.servicenow.com/community/now-platform-forum/ui-macro-variable-copy-data-from-one-mrvs-to...

 

 

If my response has resolved your query, please consider giving it a thumbs up ‌‌ and marking it as the correct answer‌‌!

 

Thanks & Regards,

Sanjay Kumar

Hello @Community Alums ,

 

The values stored in the sc_multi_row_question_answer are as line breaking statements. Please look into the attached screenshot. How to handle while fetching those multi line text values in the script, could you please help?

I am trying to convert to string it is not working.Values.png

Thanks