Adding character count to string fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 07:21 AM
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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 07:26 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 07:28 AM
This is on the backend form, there is a requirement to add that to a field on incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 07:50 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 07:57 AM
As I already pointed out, doing Client side manipulation is not recommended at all.