Would it not be handy to have a way to fill in a field based on some rules in combination with existing field values? Kind of the functionality you can achieve with Calculated Fields?
For example a naming convention to determine the name of a CI, and also in a flexible way?

In this blog article a solution will be demonstrated with the corresponding update set at the end to deploy it on your own instance.
It introduces more flexibility than out-of-the-box Calculated Fields in ServiceNow and can be used on multiple tables/fields without the need for specific scripting – as would be required when using Calculated Fields. It’s all managed from just 2 tables.

The solution consists of the following functionality

Functionality Name
Table Name Convention (u_name_conv)

  • u_table (string – table_name)
  • u_field (string)
Table Name Convention values (u_name_conv_val)

  • u_name_conv (reference)
  • u_type (choice)
  • u_value (string)
  • u_order (string)
Script Include ExtNumbMaint
Business Rule useNumbMaint
UI Action Tidy up order

In the table “Name Convention” and “Name Convention Values” all the logic for the naming is determined and registered. The “Name Convention” stores the table and the field on which you want to perform the name convention. The “Name Convention Values” table defines the values you want to use and in which order you want to use them. There are two ways to determine a value:
Continue reading…»