The Zurich release has arrived! Interested in new features and functionalities? Click here for more

tiagomacul
Giga Sage

How to remove the HTML tag in the List?

 

Sometimes we need to use HTML fields or our customers add a HTML in your own list, in fact when we're using a HTML field in the some module like incident, request or a custom module and in the list  HTML tags is displayed our user experience is depreciated, i'm facing this customer behavior for several years and i'm writing this to rember and discuss IF you would like to.

I'm using this example to illustrate what happens, How the screen looks like:

find_real_file.png

What is expected:

find_real_file.png

How to Configure:

ImageDescription
 find_real_file.png 01. Elevate Roles
 find_real_file.png 02. Select the checkbox "security_admin" and click OK
find_real_file.png03. sys_properties.list
find_real_file.png04. filter glide.ui.escape_html_list_field property
find_real_file.png05. Update value = false
 06. 
 07. 

 

WHAT YOU NEED TO KNOW (Implications of Change):

The glide.ui.escape_html_list_field property has a recomendable value that need to be considered folowing the best practices described  in "High Security Settings" for Escape HTML for HTML fields in a list view.

 

 

The system property glide.ui.escape_html_list_field escapes HTML for HTML fields in a list view. HTML is one of the types that can be assigned to the dictionary fields. Assigning "HTML" fields to any field type provides functionality to the user to format the content using HTML codes (for example, <p>,<a href>,<b>,<font>,<img> etc.). When you see the table list (for example, /problem_list.do) or view the list of records, these HTML formatted fields may appear if that column is selected in a list view and if this property is set to false. A malicious user can inject HTML code within the form field to execute unwanted scripts on different client/user sessions. It is recommended to set this property to true so that HTML escaping is performed before the records/fields are rendered in the browser when the table is displayed as a list view.

 

reference: Escape HTML, Escape HTML should be enabled, Why is unfiltered output dangerous?

 

 ALSO when we're talking about list

  • Use the record number or other unique information as the first column. Do not use a reference field as the first column. Clicking a reference value opens the referenced record, not the record that references it.
  • Do not display HTML, long string or journal fields, or other overly complex fields in list views.
  • Limit the number of columns to prevent horizontal scrolling.
  • Review the list controls and list UI actions to understand which users have access to the related operations.
  • For performance reasons, consider limiting the number of records that a list can show per page. Users can use the title menu to Show more or fewer records per page. The available values are 10, 15, 20, 50, and 100, by default. Keep in mind that lists displaying more rows per page load more slowly. This is most noticeable when a form contains related lists with many records.
    • To change the available rows per page options, navigate to System Properties > System and locate the property 'Items per page' drop-down options (comma separated, no spaces). Enter the values you want to make available to users.

 

image

Summary

Conteúdos Servicenow em Português

 

.

Comments
Amit Garg
Tera Contributor

Hi @Tiago,

If I move the html field to first column the html tags are shown on the field even after glide.ui.escape_html_list_field property is set to false. any suggestions please.

tiagomacul
Giga Sage

Hi Amit, 

  Are you talking about the first or second column?

  The first column it's recommended by ServiceNow to be Link (Symbol) about the list.

  How ever this procedure works to me so many times, please take a print to show us whar's happening, and if you could solve it, please send the solution for us.

 

 

The first column (or any references) on a list are not a clickable link to the record or reference

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0686743

 

Regards

Amit Garg
Tera Contributor

This was for the first column but there is no solution for this issue. ServiceNow denied to provide any support on this.

FrancoisLalumie
Tera Contributor

What happened to this property between Paris and Quebec?

The documentation for Paris says :

Default value = yes

Recommended Value = true

 

But starting with Quebec and forward, the documentation says :

Default value = yes

Recommended value = false

Did they flip the property around? Why does it default to true then if it's not secure? Thank you very much!

Timothy F1
Tera Guru

Some organizations won't be able to turn this system property off for security reasons. In that case you can create another field on the table and have a business rule take the text from the original field, strip the HTML, and copy it to the new field for a cleaner look. 

kaneaks12
Tera Explorer

How to manage this scnenario in workspace list view?

Version history
Last update:
‎02-22-2021 10:02 AM
Updated by: