---
sourceDocument: Xanadu ServiceNow AI Platform Administration
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/platform-administration

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Enable dynamic creation for reference fields

# Enable dynamic creation for reference fields {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

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.
   {#t_EnableDynCreationForRefFields__ul_yvh_hzm_2r}
3. Click Update.  
   Examples:

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

       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:

       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:

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

**Related concepts**   

* [Configuring the form layout](https://servicenow-prod.fluidtopics.net/1phGIP6~lfwMUKKczOxN0Q#configure-form-layout "Administrators or users with the personalize_form role can configure the form and related list layout.")

