Email field class is limiting characters to 32. How to increase the max length?

ngriffiths
Mega Expert

We have a field class on our table that is a type of 'email'.   How do I increase the max length the field will accept?   I went into the field class table and set the length value on email to 200.   I have also tried an attribute max_length=200; but it still is cutting emails to 32 characters.

find_real_file.png

1 ACCEPTED SOLUTION

ngriffiths
Mega Expert

Hi all,



Here is the resolution to this:



1. Go to "sys_glide_object.list"
2. Find and open "email"
3. Enter "100" in the "length" field and save (or update).
4. Now go to the form you want that field on.
5. Add a NEW email field! You can use the same name if you want, but more than likely the actual name will change in the background.
6. Delete or move the first email field.



If you only have a few records, you can update the data manually or if you have a bunch, then you can export the data and then import the data to the correct field.


View solution in original post

12 REPLIES 12

rob_blakey
Tera Expert

Hi Niccole,



I am not sure what version you are on, however, it looks like you are extending the 'string' class which by default has no length.
find_real_file.png


If you are trying to create this for a 'form' I would suggest adding a new field with a class of string, then using the 'max length' field for each particular item you add.



Can I also ask, what is the reason you are creating a new Field Class called email rather just using the default 'string' and adding a new dictionary entry to your form using the string as the type, then setting the 'max length' for that entry to 200?



An example of this is the "Short Description" on any task associated table.



find_real_file.png


Hi Rob,



We are on Fuji. Just to be clear, I didn't create this field class, I only made it visible.   ServiceNow provides a number of field classes, but by default, only has displayed certain ones.   Thus, as an admin, you can go to the field class table and make a field type that already exists within SNow visible/selectable, so that you can use it when building a table.



I can change it to a string field and might have to, if the database, like Sergiu described below, doesn't allow for anything over 32 characters.   The email field has a mail icon next to it and when you click on that, it opens up a new email using your default email application.



email.png



I very much appreciate your reply, as it was helpful feedback and I will most likely end up doing what you said if that field is cutting off at 32 characters.


sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Hi Niccole,



You increased the field length on UI, but I remember we had some issues in the past where increasing the length on UI would not increase the length on database side. The behavior you experience now suggests me that on database side the field still has a length of 32 char.


You need to make sure length was increased on database side as well, and that can be checked by ServiceNow support personnel. You will need an incident for this.



Regards,


Sergiu


Thanks Sergiu!   I will wait to hear back from SNow on this