Transform maps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 10:25 PM
Create Transform map and load the data like in the excel sheet there are 10 rows data 1 to 5 Mandatory & 6 to 10 Non - mandatory.
Any idea how to build the sample transform map script , exact code ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 11:58 PM
Hello @Ram012 ,
Create a Transform Script, set "When" to "onBefore" and use the following script, but put in your own Excel sheet column names of course.
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
var mandatoryColumns = [
'u_column1',
'u_column2',
'u_column3',
'u_column4',
'u_column5'
];
if (mandatoryColumns.some(col => !source[col])) {
ignore = true;
log.error('Mandatory data is missing in row ' + source.sys_import_row);
};
})(source, map, log, target);
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2025 12:56 PM
Hi @Ram012
The steps are:
- Navigate to system import sets -- > load data
- Load the excel sheet
- Once the data is loaded, you would get the Create transform map option (this would come up if there is no existing transform map present in the instance)
- Here you can select the target table, and then map the columns in the excel sheet to the fields on the target table.
- Once the mapping done, you need to click on transform now.
If my response helped please mark it correct and close the thread so that it benefits future readers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2025 06:42 AM
Sorry but you didn't share what you have configured and what's not working, so can't help much.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader