Adding character count to string fields

snadmin123
Mega Expert

Is it possible to add the character counter similar to larger text fields for small fields? I have a 4000 character field which shows character count remaining but 100 character string field doesn't show that. Is it possible to set that up ?

4 REPLIES 4

Jakub_Offierski
Tera Contributor

Can you specify if this is in the backend UI or in the Portal? There's a difference in how things work.

Generally, in the back end, this is not possible. Previously (this question was asked many times before such as here: Character Counter for text fields that are not jou... - ServiceNow Community), you could do some Client side trickery but ServiceNow actively discourages using DOM manipulation to do so.

 

Your best bet is to inform your users better or to talk with the person demanding this feature on what the real purpose is here.

snadmin123
Mega Expert

This is on the backend form, there is a requirement to add that to a field on incident.

@snadmin123 

 

For multiline text/textarea fields, there is a system property available in the ServiceNow: glide.ui.textarea.character_counter, which is enabled in your system that's the reason you can see the character count for that.

But it doesn't work for the normal String type field, I believe you need to create some custom solution for that using the client scripts or BRs.

 

If my answer solved your issue, please mark my answer as  Correct & 👍Helpful based on the Impact.

As I already pointed out, doing Client side manipulation is not recommended at all.