ServiceNow Transform Map Interview Questions 2025
What are the different type of script available in transform map?
There are 7 type of transform map script which gets executed at different point of time while transformation,
1. onStart: executes at the start of an import before any rows are read.
2. onAfter: executes at the end of a row transformation and after the source row has been transformed into the target row and saved.
3. onBefore: executes at the start of a row transformation and before the row is transformed into the target row.
4. onChoiceCreate: executes at the start of a choice value creation before the new choice value is created.
5. onComplete: executes at the end of an import after all rows are read and transformed.
6. onForeignInsert: executes at the start of the creation of a related, referenced record before the record is created.
7. onReject: executes during foreign record or choice creation if the foreign record or choice is rejected. The entire transformation row is not saved.
Note : In addition to above types, we do have main transform map script (which is available when we click on run script checkbox) and Field Mapping script.
There are 7 type of transform map script which gets executed at different point of time while transformation,
1. onStart: executes at the start of an import before any rows are read.
2. onAfter: executes at the end of a row transformation and after the source row has been transformed into the target row and saved.
3. onBefore: executes at the start of a row transformation and before the row is transformed into the target row.
4. onChoiceCreate: executes at the start of a choice value creation before the new choice value is created.
5. onComplete: executes at the end of an import after all rows are read and transformed.
6. onForeignInsert: executes at the start of the creation of a related, referenced record before the record is created.
7. onReject: executes during foreign record or choice creation if the foreign record or choice is rejected. The entire transformation row is not saved.
Note : In addition to above types, we do have main transform map script (which is available when we click on run script checkbox) and Field Mapping script.
What is the sequence of execution for different type of transform map script?
The correct sequence of transform map script is as follows:
1. onStart.
2. on Before.
3. Source Field script.
4. Run script, the script we can find after checking the 'Run Script' check box.
5. onAfter
6. onComplete
Below diagram represents graphical representation of execution order:

The correct sequence of transform map script is as follows:
1. onStart.
2. on Before.
3. Source Field script.
4. Run script, the script we can find after checking the 'Run Script' check box.
5. onAfter
6. onComplete
Below diagram represents graphical representation of execution order:

What is coalesce in transform map?
The coalesce option allows you to update existing target table records when transforming import data.
The coalesce option on a field map allows you to specify if the selected Target field should be used to coalesce on when import set records are transformed. If the field map Coalesce checkbox is selected, when the import set row is transformed the instance checks for an existing record in the target table that has the same value in the Target field as the import set row Source field.
If an existing record with a matching value in the target table is found, that record is updated. If no matching record is found, then a new record is created in the target table.
The coalesce option allows you to update existing target table records when transforming import data.
The coalesce option on a field map allows you to specify if the selected Target field should be used to coalesce on when import set records are transformed. If the field map Coalesce checkbox is selected, when the import set row is transformed the instance checks for an existing record in the target table that has the same value in the Target field as the import set row Source field.
If an existing record with a matching value in the target table is found, that record is updated. If no matching record is found, then a new record is created in the target table.
Can we apply coalesce on multiple field?
Yes, we can apply coalesce on multiple fields. If we add coalesce for multiple field then all fields that are marked 'true' must match to do an update of an existing record.
Yes, we can apply coalesce on multiple fields. If we add coalesce for multiple field then all fields that are marked 'true' must match to do an update of an existing record.
How to restrict insertion of new records and allow only update of existing records?
In transform map main script, we can check for operation by using 'action' variable and set 'ignore' variable as true/false based on the value as shown in below script :
if(action=='insert'){
ignore=true;
}
In transform map main script, we can check for operation by using 'action' variable and set 'ignore' variable as true/false based on the value as shown in below script :
if(action=='insert'){
ignore=true;
}
What are the different variables available in transform map scripts?
1. source: Contains the import source record currently being transformed. Specify a specific field from the source record as an object property.
2. target : Contains the transformation map record currently being used for the transformation process. Specify a specific field from the transform map record with one of these properties.
3. log : Log information about the current import process. Each log level has it\'s own method.
4. ignore : When set to true, skips or aborts the current import action. In onStart scripts, this variable aborts the entire transformation process. In onBefore scripts, this variable only skips the current row being transformed.
5. error : When set to true, aborts the current import action and logs an error message in the Import Set Log.
6. error_message : When an error occurs, adds the specified error message to SOAP response.
7. status_message : Adds the specified status message to SOAP response.
1. source: Contains the import source record currently being transformed. Specify a specific field from the source record as an object property.
2. target : Contains the transformation map record currently being used for the transformation process. Specify a specific field from the transform map record with one of these properties.
3. log : Log information about the current import process. Each log level has it\'s own method.
4. ignore : When set to true, skips or aborts the current import action. In onStart scripts, this variable aborts the entire transformation process. In onBefore scripts, this variable only skips the current row being transformed.
5. error : When set to true, aborts the current import action and logs an error message in the Import Set Log.
6. error_message : When an error occurs, adds the specified error message to SOAP response.
7. status_message : Adds the specified status message to SOAP response.
What do you mean by Foreign record insert in transform map?
A foreign record insert occurs when updating a reference field on a target table. If reference field doesn't exist then transform map creates new entry in reference table. This behaviour can be managed by 'Choice Action' field on field mapping record.
A foreign record insert occurs when updating a reference field on a target table. If reference field doesn't exist then transform map creates new entry in reference table. This behaviour can be managed by 'Choice Action' field on field mapping record.
Prepared and confident for your interview?
Practice makes perfect! Test your skills with our virtual interview practice buddy and ensure you're fully ready for your upcoming interview.
User Added Interview Question and Answers
Maximum no of records that could be import through transform map
What is the use of choice action in transform maps?
while transforming the data from excel sheet to target table the business rule which has written on target table is that will run or not ?
How we can add 51-100 record out of 100 record available in Excel file.
How we can add 51-100 record out of 100 record available in Excel file.
🚀 Power Up Your ServiceNow Career
Join a growing community of smart ServiceNow professionals to stay ahead in interviews, sharpen your development skills, and accelerate your career.
Fuel My Passion
Loving the content? Well, of course you are. Here’s your chance to indirectly fuel the chaos that keeps this website running. Your contribution helps keep the wheels turning and allows me to continue pretending to be a responsible adult—while cranking out more content for you. Thanks for supporting my delusional dreams and helping me keep this website alive!
Buy Me a Coffee
Support with UPI
If you prefer making a UPI payment to support the website maintenance cost, scan the QR code below: