Integration
What is the Import Set and Transform Map in ServiceNow?
The question
What is the Import Set and Transform Map in ServiceNow? Describe a scenario where you'd use them.
What the Interviewer Wants to Hear
Data import is a critical operation in every ServiceNow implementation. Import Sets and Transform Maps are how external data (CSV files, API feeds, Excel spreadsheets) gets loaded into ServiceNow tables.
The Two-Step Process
- Import Set: The raw data landing zone. External data is loaded into a temporary staging table first — not directly into the target table. This staging table is called an Import Set table.
- Transform Map: The mapping rules that convert staging data into target table records. It defines which source column maps to which target field, and includes logic for data transformation and upsert handling.
Real Scenario: Employee Onboarding
// HR sends a CSV every Monday with new hires:
// first_name, last_name, email, department, start_date
// John, Smith, john.smith@company.com, Engineering, 2026-04-01
// Jane, Doe, jane.doe@company.com, Marketing, 2026-04-01
// STEP 1: Data Source (scheduled or manual)
// Configure a Data Source pointing to the CSV file location
// ServiceNow reads the CSV and loads rows into staging table
// STEP 2: Import Set (staging table)
// Table: u_new_hire_import
// Each CSV row becomes a record in this staging table
// Data is raw — no validation yet
// STEP 3: Transform Map
// Maps staging columns to target table (sys_user):
// u_first_name → first_name
// u_last_name → last_name
// u_email → email
// u_department → department (lookup by name)
// u_start_date → u_start_date
//
// Coalesce field: email
// If email exists in sys_user → UPDATE that record
// If email doesn't exist → INSERT new record
// STEP 4: Transform runs
// Each staging row is transformed and written to sys_user
// Transform scripts can run additional logic:
(function transformRow(source, target, map, log, action) {
// Auto-generate user_name from email
target.user_name = source.u_email.toString().split('@')[0];
// Set default password
target.user_password = 'Welcome2026!';
})(source, target, map, log, action);Key Concepts
- Coalesce field: The matching key for upsert logic. If a record with this value exists in the target, UPDATE it. If not, INSERT a new one.
- Transform scripts: Run before/after each row or at the start/end of the entire import. Use for data cleanup, validation, or custom logic.
- Import Set Run: Each import execution creates a 'run' record with success/failure counts. Check here for errors.
💡 Interview Tip
The typical gotcha question: 'What happens if you set the wrong coalesce field?' If the field isn't unique (e.g., 'department' instead of 'email'), the transform will update the FIRST matching record for all rows with the same department — destroying data. Always choose a unique identifier as the coalesce field.