A company needs to import user records from a CSV file into the User [sys_user] table. The file contains a 'department' column that should map to the 'department' field in ServiceNow. However, the department values in the CSV are full names (e.g., 'Human Resources'), but the department field in ServiceNow uses a reference to the Department [cmn_department] table. What is the best practice for handling this import?
Trap 1: Use a before business rule on the User table to convert the…
Business rules run after insert, not during mapping.
Trap 2: Use the Import Set Row API to programmatically map the values…
The API inserts raw data; mapping is done via transform map.
Trap 3: Manually edit the CSV file to replace department names with the…
Manual editing is not scalable and error-prone.
- A
Use a before business rule on the User table to convert the department name after the record is inserted.
Why wrong: Business rules run after insert, not during mapping.
- B
Create a transform map that maps the source field to the target field, and use a field mapping script to convert the department name to the correct sys_id.
This is the standard method to handle reference field mapping during import.
- C
Use the Import Set Row API to programmatically map the values during import.
Why wrong: The API inserts raw data; mapping is done via transform map.
- D
Manually edit the CSV file to replace department names with the corresponding sys_id values.
Why wrong: Manual editing is not scalable and error-prone.