- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2025 07:08 AM
Hi all,
I’m looking to import data from an Excel file into ServiceNow using transform maps. The goal is to conditionally route records to different target tables based on the value of a specific column.
For example, if a column in the Excel file contains the value "Texas", those records should be imported into Target Table B, with all other columns mapped accordingly. Records where the column value is not "Texas" should be imported into Target Table A, also with all other columns mapped.
Please let me know the best way to achieve this within a transform map configuration.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 09:16 AM
Thanks for your help. I was able to achieve this and make it all work by creating this action found here by and removing the ones I previously added.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 05:33 AM
I suggested to use only 1 transform map as your data is scattered and handle everything in onBefore transform script
As per your above images "Load data source", "Transform Import Set" are out of the box flow actions or custom one?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 07:36 AM - edited 06-11-2025 09:17 AM
@Ankur Bawiskar I think they are custom. Wonder it's this transform import set action script the issue, as when I manually run the transform in the data source, works correctly for both targets table. I shared the script of the action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 08:40 AM
seems line 9 is causing only 1 transform map to trigger.
you can debug that.
did you get a chance to check below link?
check this link and script shared by Fabian
Usage of GlideImportSetLoader & GlideImportSetTransformerWorker API's from scoped Application
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 09:16 AM
Thanks for your help. I was able to achieve this and make it all work by creating this action found here by and removing the ones I previously added.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2025 07:21 AM
Steps
1) Don't use field maps
2_ you can use single transform map on any target table either A or B and handle everything in onBefore transform script
Something like this
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
if (source.u_field == 'Texas') {
// handle GlideRecord insert/update on Target Table B
ignore = true; // so that nothing is inserted into target table of transform map
} else {
// handle GlideRecord insert/update on Target Table A
ignore = true; // so that nothing is inserted into target table of transform map
}
})(source, map, log, target);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader