Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to render HTML content in journal fields ?

DarshanaGoli
Tera Contributor

Please share how we can render HTML content in journal fields and show it in Activities tab without enabling system property - glide.ui.security.allow_codetag as it imposes a risk on instance. We are trying to replicate a chat window kind of thing in Activities tab where queries are received from external system which can be inline images, tables, hyperlinks, etc. There queries are then referred by our users to respond back. 

 

2 REPLIES 2

vignesh parthib
Tera Guru

Hi @DarshanaGoli 

 

Customizing journal fields to render HTML isn’t best practice in ServiceNow due to security risks, maintenance challenges, and breaking native functionality. Use supported alternatives like custom tables or Service Portal widgets instead.

Risks:

  • Future developers may not understand the custom logic.

  • Harder to maintain across upgrades or platform changes.

  • Increases the technical debt of your ServiceNow implementation

Thanks,
Vignesh
"If this solution resolves your issue, kindly mark it as correct."

ChrisBurks
Giga Sage

Out-of-box the glide.ui.security.allow_codetag (allows HTML) is enabled (set to true) and it's the property glide.ui.security.codetag.allow_script (allows script HTML script tags) that is disabled. However, your organization may have chosen to disable glide.ui.security.allow_codetag.

 

If that is the case a simple solution could be to use an HTML field that is set to read only.  The HTML in ServiceNow already strips away <script> tags and sanitizes the HTML.

With that type of field you could design a make shift chat.

I am assuming the external system is an integration supplying responses to the queries.

 

The following below is a very primitive proof of concept where an HTML field is used instead of the Activity (because if codetag is off it won't render html) :

query_dialog.gif