HTML Field Encoding Issue in ServiceNow Projects Table – How to Prevent Unwanted HTML Encoding?

Joseph1
Tera Contributor

Hi everyone,

I'm encountering an issue with a field in the Projects table in ServiceNow. The field in question is of type HTML, and it's used to store business case descriptions. However, when the content is saved or displayed to the 'activity stream', special characters like quotation marks (") and apostrophes (') are being encoded as HTML entities (", ', etc.).

I've checked the following:

  • Business Rules: No encoding appears to be happening here.
  • Client Scripts and UI Policies: No encoding scripts found.
  • Script Includes: Reviewed relevant script includes but found nothing that would cause this issue.

I’m looking for advice on:

  1. How to prevent or manage this HTML encoding: Should I change the field type, or is there a best practice for handling HTML fields in ServiceNow?
  2. Any potential configurations or settings: Are there specific settings or plugins that might be responsible for this behavior?
  3. Decoding Best Practices: If I need to keep the field as HTML, what’s the best way to ensure the text is displayed correctly without unwanted encoding?
3 REPLIES 3

Mark Manders
Mega Patron

It depends: are you copying the content to a work note/comment, or have you added the field as part of the activity log? I just checked on doing the latter: it copies everything as is on my OOB instance when I add the HTML field to be included. 

If you are copying the content, it may be worth checking why you don't put the field in the activity log, because (OOB) that should go as expected.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Hello Mark, thank you for your reply! I will try what you mentioned and let you know.

Hello Mark,

So, I tried adding the field to the activity stream and that is working for the new updates to the field, but the issue I see is with the first activity.

After digging deeper i found an integration which does the transformation of data to the project records, i believe that would need to be tweaked to fix the encoding happens. So, mostly i will found the developers responsible already as it is ongoing project. 

 

Thank you

Joseph