Enable dynamic creation for reference fields

task australia Updated Sep 10, 2026 1 min read t_EnableDynCreationForRefFields.md
Raw file servicenow.com

When dynamic creation is enabled, entering a nonexistent value in a reference field creates a new record on the referenced table instead of returning an error.

Before you begin

Role required: personalize_dictionary

About this task

By default, a user must enter a value in a reference field that matches an existing record in the table that the reference field refers to. For example, the Caller field in an Incident must have a value that is an existing user. You can enable dynamic creation to create a new record on the referenced table when a user enter a nonexistent value in a reference field instead of returning an error.

Procedure

  1. Right-click the field label in the form and select Configure Dictionary.

  2. Populate the following fields (you may need to configure the Dictionary form):

    • dynamic_creation: Select the check box.
    • dynamic_creation_script: Enter a script that dynamically creates the record.
  3. Click Update.

    Examples:

    You could use the following dynamic_creation_script to create a record on the referenced table.

    JavaScript
    current.name = value;current.insert();

    Note: The parent object can be used to access anything from the parent record.

    You could create a script include named MyUserReferenceCreator with the following contents:

    JavaScript
    var MyUserReferenceCreator = Class.create();MyUserReferenceCreator.prototype = {    initialize: function() {    },     create: function(current, value) {        current.name=value;        return current.insert();    },     type: 'MyUserReferenceCreator'}

    When the script include is created, the following dynamic_creation_script generates a new location for an invalid reference field value:

    JavaScript
    new MyUserReferenceCreator().create(current, value);

Related topics

Configuring the form layout

Search documentation
Search document titles and file paths on the australia branch