Create a transform in Service Exchange

  • Rversion finale: Australia
  • Mis à jour 12 mars 2026
  • 3 minutes de lecture
  • As a provider or a consumer, create a transform in Service Exchange to integrate tasks between connected instances.

    Avant de commencer

    Role required: admin

    Pourquoi et quand exécuter cette tâche

    The following steps describe the transform process for providers. Consumers can navigate to All > Service Exchange Consumer > Transforms and follow the same process.

    Procédure

    1. Navigate to All > Service Exchange Provider > Administration > Transforms.
    2. Click New.
    3. On the form, fill in the fields.
      Tableau 1. Transform form
      Field Description
      Number Auto-generated number for the transform record.
      Company Consumer name for whom this transform is applicable.
      All Companies

      If this is selected, the transform runs for all companies except those with the same company level transform.

      Use this field to create a default transform definition that can be applied to all companies. The All companies field eliminates the need to define a specific transform for each customer account even when they have similar requirements. You can use the default definition to transform specific fields across all companies simultaneously.

      The global transform is applied only to companies that match the configuration and do not have a specific transform already defined. If a company specific transform for the same configuration already exists, this will override the global transform.

      Type
      • Simple: Used when the field has a known and stable choice list on each instance. A related list of transform lines is created to match the inbound and outbound values.
      • Advanced: Used for complex criteria that requires a script to determine the new value.
      • Virtual Inbound: Used to transform a virtual inbound field. Requires a script to determine the new value.
      • Virtual Outbound: Used to transform a virtual outbound field. Requires a script to determine the new value.
      Inbound Option that enables an inbound transformation for this transform. This option is available only if you select the Type as Simple or Advanced.
      Outbound Option that enables an outbound transformation for this transform. This option is available only if you select the Type as Simple or Advanced.
      Provider table Option that designates the provider's task table. For example, Case.
      Consumer table Option that designates the consumer's task table. For example, Incident.
      Provider field Option that designates the provider's field. For example, State. This field is available only if you select the Type as Simple or Advanced.
      Consumer field Option that designates the consumer's field. For example, State. This field is available only if you select the Type as Simple or Advanced.
      Virtual field When Type field is set to Virtual Inbound or Virtual Outbound, this field is available to reference the virtual field this transform should populate.
    4. Click Save.
    5. Select one of the following:
      1. Simple: Click New in the Transform lines related list, and fill in the fields on the form.
        Tableau 2. Transform lines form
        Field Description
        Provider label Option that designates the provider's choice label. For example, Open.
        Provider value Option that designates the provider's choice value. For example, 10.
        Customer label Option that designates the customer's choice label. For example, Progress.
        Customer value Option that designates the customer's choice value. For example, 2.
        Remarque :
        You can generate transform mappings between provider and consumer tables automatically using the Transform Mapping Assist feature. For more information, see Automate transforms with Now Assist for TMT.
      2. Advanced: Use a script to define the outbound and inbound labels and values as shown in the following example:
        output.value=input.value;
        output.label=input.label;
        
        var ci=new GlideRecord('cmdb_ci');
        
        if(direction=='inbound'){
           if(ci.get('correlation_id',input.value)){
              output.value=ci.sys_id+";
              output.label=ci.getDisplayValue();
              }
        }
        if (direction=='outbound'){
          if(ci.get(input.value)){
             if(ci.correlation_id){
                output.value=ci.correlation_id+";
                output.label=input.label;
               }
            }
        }
              
        
      3. Virtual Inbound: Use a script to determine the inbound label and value as shown in the following example:
        var inputArr = input.value.split(',');
        var outputValues = [];
        var outputLabels = [];
        for (i in inputArr) {
            getInstanceID(inputArr[i]);
        }
        output.value = outputValues+'';
        output.label = outputLabels+'';
        
        function getInstanceID(name) {
            var gr = new GlideRecord('cmdb_ci_server');
            if (gr.get('name', name)) {
                outputValues.push(gr.sys_id+'');
                outputLabels.push(name);
            }
        }
      4. Virtual Outbound: Use a script to determine the outbound label and value as shown in the following example:
        /*
         ** The 'input' object contains the original value and label
         ** 'direction' contains an 'inbound' or 'outbound' value to determine transform direction
         ** 'object_data' contains the Remote Task GlideRecord
         ** It is required to set the variables 'output.value' and 'output.label' with your script.
         */
        output.value = 'condev,conprod';
        output.label = 'condev,conprod';
    6. Click Submit.
    7. On the transform form, click Activate.

    Résultats

    A transform record is created on your ServiceNow® instance. Any Remote Task's inbound or outbound fields that match a transform will automatically use them. To learn more, see Create a remote task definition in Service Exchange for Providers.