Limit Characters in a Ticket Form Field? | Community
Skip to main content

Limit Characters in a Ticket Form Field?

  • June 26, 2015
  • 7 replies
  • 0 views

Is it possible to limit the numbers of charters allowed in a field in a ticket form?  As an example, you have a field for a material descriptor but you want to limit to only allow 40 characters of text as that is all that will show on the product when entered.

This topic has been closed for replies.

7 replies

  • July 31, 2015

Hi Joey! Sorry for the delay here.

Using the regular text field it's not possible to limit the number of characters, but you might be able to accomplish this using the Regular Expression field.

Hope that helps!


Meena13
  • September 8, 2015

Hi Joey,

Were you able to accomplish that with Regular Expression or another way?  Because we're in the same dilemma where we want to enter text but since the Insight GoodData Report only shows 128 characters and rest of the text is truncated hence we want to limit the Text Field to 128 characters limit.  Thank you in advance!


  • Author
  • September 8, 2015

Hi Meena,

I was not able to accomplish this.  It may be that I'm not quick savvy enough to figure out how to write the regular expression needed to accomplish this.  If you figure something out, please let me know!


Meena13
  • September 8, 2015

I used the following Regular Expression to limit the characters including numbers to 10:

^[A-Za-z0-9]{1,10}$

While testing it in the Sandbox once you try to save/submit the ticket, it gave an error saying "Expression Field: is invalid" but it does it by taking you out of the ticket and to the Unsolved Tickets view and gives an option to click on "Fix this" which takes you back to the ticket and gives the message on the top left hand side "Expression Field: is invalid".  I don't like how it takes you out of the ticket instead of giving you the error how it does it for required Text fields.  You can try using that expression and change the last number in {} to whatever limit you want to set it too.  My next step is to see if this field gets imported to the Insight Report or not since only some fields do.  Hope that helps!


  • April 24, 2017

I used ^.{0,50}$ to limit it to 50 characters (including spaces and special characters).

 

But, it would make much more sense for Zendesk to implement the option to limit to a maximum amount of characters as an option for regular form fields as well. 


  • January 14, 2019

Hey Guys, where we can use this regular expression? My problem statement is when an agent works on the ticket, there are a few fields in the form, that he manually enters. Can I limit the character of that field?

Please help


  • January 16, 2019

Kriti,

You can only set RegEx on that particular custom ticket field type.  If you would like more information on building Regex expressions, I found the following external link that might help, https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch04s09.html.

Additionally, the idea of creating a feature to limit character length in other field types is a great idea.  Would any/all of you mind posting in our Feedback Forum so have our Dev team review the uses case and look at possibly adding this to our Development Roadmap?