Creating a custom field type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 10:44 PM
Hi All,
I want to use an email field type in SCTASK table but it is not an OOB field type. So, how to create a field type/ field class in servicenow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 10:57 PM
Hi @Pankaj kr
you cannot create custom field types.
However, you, can make the field type "Email" visible. If you go to table sys_glide_object you can see that for the email type the field "Visible" is set to "false". OOTB you cannot change that, but you can disable the respective ACL and set "Visible" to "true". After that you can create a custom field in your table with the type "Email".
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 11:00 PM
Hi @Pankaj kr ,
it's not a best practice to create a new field other than what Service Now has provided OOB. But still if you want to create a new field Type you need to navigate to the table "sys_glide_object.LIST"
you'll need to do a couple of additional steps to get this going the first time. Create your new field like this in your table creator...
Next, you'll need to update the 'write' ACL for the 'sys_glide_object' table to allow you to make the 'Email' value visible and selectable when changing field types. You can do this by navigating to 'System Security -> ACLs' in your left nav and finding the 'sys_glide_object' ACL for the 'write' operation. Once it's open you'll want to check the 'Admin overrides' checkbox and update the ACL.
Once that's done you should be able to navigate to 'sys_glide_object.list' using the search bar at the top of your left nav to open the 'Field class' table and find the 'Email' object. Open that record and check the 'Visible' checkbox.
Finally, open up the dictionary entry by clicking on the field name from the related list in the table creator form like this...
Once you're in the dictionary you can adjust the 'Type' field from 'String' to 'Email' and save.
Also note that once you've enabled the 'Email' option, this will be selectable for any new fields created from that point on. You don't have to go into the dictionary as a separate step, just select it as you're creating the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 03:05 AM
Hi Sandeep,
It works but is there anyway to create our own custom field. I have one requirement where user wants to provide multiple text but in a seperate field.
for example: there is a serial number field and user wants to enter 5 serial number each on a field. Here the user wants to have plus icon beside serial number field and when user clicks on that icon the copy of that field gets added below it. similarly if user doesn't needs that variable they can click minus sign to not use the new field. its similar like key value pair type field in servicenow but i don't want any value here and want to name the field as per my choice. Is it possible, using a custom variable type? if yes then how to create such variable type.
Thanks,
Pankaj kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 02:57 AM
Hi @Pankaj kr
Have look at OOTB email field on user table, it may be helpful
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************