Implement and leverage custom controls built using the custom control framework in your integration.

Before you begin

Role required: virtual_agent_admin or admin

About this task

Map custom controls to a provider channel.
Implement custom controls created in Flow Designer
Use the example script to implement custom controls created in Flow Designer.
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 Flow Designer 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.
Note: 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.

Procedure

  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.
  4. Select Submit.