@servicenow/sdk - v4.7.0
    Preparing search index...
    • Creates an Import Set: defines how rows in a staging/source table are transformed and loaded into a target table (sys_transform_map).

      Parameters

      • config: ImportSet

        an object containing the following properties:

        • $id - unique id for the record, typically using Now.ID["value"]

        • name - display name of the import set

        • targetTable - table receiving the final records (e.g., incident)

        • sourceTable - staging/source table holding raw rows (e.g., u_import_incidents)

        • order? - execution order for multiple import sets; lower runs first

        • active? - whether the import set is enabled

        • runBusinessRules? - whether to run business rules on the target table

        • enforceMandatoryFields? - mandatory enforcement level ('no' | 'onlyMappedFields' | 'allFields')

        • copyEmptyFields? - whether empty source values overwrite target values

        • createOnEmptyCoalesce? - insert a new record when no coalesce match is found

        • fields? - field mappings for loading data into the target table. Each key is a target field and the value is either:

          • a string: 'source_field' for direct mapping, or
          • an object with:
            • sourceField - name of the source column
            • coalesce? - mark this as a match key for updates (with coalesceCaseSensitive? and coalesceEmptyFields?)
            • choiceAction? - how to handle unmapped choices ('reject' | 'ignore' | 'create')
            • dateFormat? - parse dates using a specific format
            • referenceValueField? - alternate source column to resolve reference values
            • useSourceScript? - enable a per-field transform
            • sourceScript? - a function (source) => any or a string script executed before mapping
        • scripts? - array of transform scripts run at specific lifecycle points with:

          • active? - whether this script runs
          • order? - script execution order
          • when? - lifecycle timing (onBefore | onAfter | onReject | onStart | onForeignInsert | onComplete | onChoiceCreate)
          • script? - string script body
        • runScript? - whether to run a top-level map script

        • script? - string content of the top-level map script when runScript is true

      Returns ImportSet