ServiceNow Import & transform scripts
Shape and clean incoming data as it flows from an import set into target tables.
Transform scripts run inside a transform map at five events: onStart before any rows, onBefore and onAfter around each row, onComplete at the end and onForeignInsert when a referenced record must be created. In onBefore, source is the import-set row and target the record being written; set ignore to skip a row or error to reject it.
- The transform events
- An onBefore script
- Coalesce and field maps
- Try it Yourself
When you load data with import sets and transform maps, transform scripts are the code hooks that let you clean, enrich and control each row as it is written to the target table. They turn a dumb column-to-column map into a smart, defensible data pipeline.
The transform events
An onBefore script
source is the import-set row, target is the record being written. Set ignore = true in onBefore to skip a row, and use error = true with a log message to reject bad data instead of silently corrupting the target table.Coalesce and field maps
A coalesce field decides insert-vs-update (match found = update). Prefer field maps and coalesce for the simple stuff; reserve scripts for transformations the mapping UI can't express.
▸ Press Run to execute.
Runs in a sandbox in your browser. Mock gs and GlideRecord and sample data are provided.