- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 08:54 PM
Hi All,
I have got a requirement where I need to be put HTML tags to the description field. This is because the catalog items are being pushed from a third party system using a web-services integration. I know you can edit this using the features available in the text such as bold, italics etc but the integration is supposed to be fully automated without any manual intervention.
Hence, when I tried to use HTML tags, it is translating them literally, any ideas?
Mussie
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 09:00 AM
You could transform that field by using the "unescapeText" method in the JSUtil Script Include (JSUtil - ServiceNow Wiki). It will restore the string back to "normal" HTML code for you. The example in the Wiki article shows the exact same issue you are running into.
Your code would be as simple as something like (untested):
target.description = JSUtil.unescapeText(source.u_description);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 09:36 AM
OK, so we need to see how the data is coming in to that field now from the web service. Can you share the data? Are you just taking the data as is and dropping it into the field or are you manipulating it somehow, etc...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2016 04:24 PM
Hi Jim,
Thanks for your response. At the moment, the catalog items are pushed daily from a third-party application into ServiceNow via a Webservices Import set then onto sc_cat_items table. And the description data is just plain text at the moment and the requirement is to have html tags included. There is no data manipulation going on at the moment, we are pushing the data as is.
Mussie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2016 07:46 PM
Hi Mussie,
You have to request third party application owner while pushing data to servicenow convert it in HTML or before data push in target table convert the plain text in to HTML.
Regards,
Abhishek Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 09:00 AM
You could transform that field by using the "unescapeText" method in the JSUtil Script Include (JSUtil - ServiceNow Wiki). It will restore the string back to "normal" HTML code for you. The example in the Wiki article shows the exact same issue you are running into.
Your code would be as simple as something like (untested):
target.description = JSUtil.unescapeText(source.u_description);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 04:16 PM
Thanks for your help Jim, I will test it and let you know...I will mark it as correct answer for now until I test it and know the results.
