- 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-14-2016 09:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 09:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 10:01 PM
And another question - I'm assuming you are encoding the data sent over the web service, so are you decoding it first before inserting/updating the Catalog Item record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 11:03 PM
