Integrate custom controls

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:7分
  • Implement and leverage custom controls built using the custom control framework in your integration.

    始める前に

    Role required: virtual_agent_admin or admin

    このタスクについて

    Map custom controls to a provider channel.
    Implement custom controls created in Workflow Studio
    Use the example script to implement custom controls created in Workflow Studio.
    Example: Custom controls support
    {
        uiType: "CustomControl",
        group: "DefaultCustomControl",
        name: "The name of the Custom Control (sys_cs_custom_control.name)",
        required: true/false,
        uxComponentDefinitionSysId: "seismicComponentId" // or null if not
        isInput: true/false, // whether to wait for a response value or if just output
        serializedControlData: "User defined JSON from generateControlData function";    
    }
    Example: Custom controls script
    (function execute(inputs, outputs) {
        var rich_controls = inputs.rich_control;
        //this is the data returned from the 'serialized control data function' defind in designer
        var serializedControlData = rich_control['serializedControlData'];
        // if this rich control will require a response to move forward in topic flow
        var isInput = rich_control['isInput'];
        // if the component is suggesting using a Seismic control (web) that handles this
        var uxComponentDefinitionId = rich_control['uxComponentDefinitionSysId'];
        // the name of the custom control
        var name - rich_control['name'];
    
        // 1) now perform some logic to transform this data into a custom ui (slack/facebook/sms ascii art/html/etc)
        // 2) attach to outputs, i.e. outputs.text_message='foo :)'; for sms twillio
    
        // basic flow is to take the serializedControlData/Name/compId(optional) and create a custom UI component here
        // that your client understands (i.e. a slack rich form payload)
    })(inputs, outputs);
    Implement a provider-specific transformation of a custom control
    You can implement a provider-specific transformation for each custom control by using the Sub type field in the Custom Adapter Configuration [sys_cs_custom_adapter_config] table. You can publish a newer version of a custom control or a pre-built, ServiceNow custom control, also referred to as a default custom control, if needed. This involves publishing the appropriate Inbound and Outbound Workflow Studio action scripts and updating the configuration in the Custom Adapter Configuration [sys_cs_custom_adapter_config] table.
    • If you're publishing your own version of a ServiceNow custom control, overwrite the custom control record in the Custom Adapter Configuration table with your own Inbound and Outbound action script names.
    • Only one record with the same Sub type is allowed. If the same custom control is implemented by two different parties, only one can update the existing record with new Inbound and Outbound transformers.
    注:
    Once you override an existing custom control record, the system uses the new version of the custom control. For example, transformation scripts can transform multiple custom controls, such as Time Picker and Auth. If you add a Time Picker control with different inbound and outbound transforms, the newer Time Picker control is used. You cannot revert to the original version of the custom control.

    手順

    1. Navigate to All, and then enter sys_cs_custom_adapter_config.list in the filter.
    2. Select New.
    3. On the form, fill in the fields.
      表 : 1. Custom Adapter Configurations form
      Field Description
      Provider The name of the channel identifier for your custom chat integration. For details, see Create a channel identifier for your custom chat integration.
      Control type

      Select the custom control that you designed. For custom controls, the type is always DefaultCustomControl.

      To learn more about custom controls, see Customizing Virtual Agent with custom controls.

      Sub type Name of the custom control.
      Inbound transformer action Name of the inbound transformer action script for this rich control, such as, sn_va_sms_twilio.va_sms_twilio_adapter_input_text_inbound_transformer.
      Outbound transformation action Name of the outbound transformer action script for this rich control, such as, sn_va_sms_twilio.va_sms_twilio_adapter_input_text_outbound_transformer.
    4. Select Submit.