Run transform in server side script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2015 12:00 AM
Hello All,
Is there any way to "run transforms" in server side script? any APIs?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2017 05:35 PM
You need to have the transform map and import set created ahead of time.
See example below:
var transformMapSysID = '';//Your sys_id here
var transformMap = new GlideRecord('sys_transform_map');
transformMap.get(transformMapSysID);
var importSetSysID = '';//Your sys_id here
var igr = new GlideRecord('sys_import_set');
igr.get(importSetSysID);
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2017 07:07 AM
Thank you Paul, this is really helpful. I greatly appreciate your help. The example is really insightful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 10:37 AM
Hi Paul,
can we get the result of the transform initiation? like which record was inserted/updated the sysid etc
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 06:01 PM
These functions are also available for GlideImportSetTransformerWorker, which may help:
getImportSetRun () | |
getOutputSummary () | |
getParentController () | |
getProgressID () | |
getProgressMessage () | |
getProgressState () | |
getProgressTable () | |
getWorkerThreadID () |
Don't forget to mark this thread as correct if you have got your answer
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 10:53 PM
Hi Paul,
Thanks for your time.
I am using the class like
var t = new GlideImportSetTransformerWorker(igr.sys_id, transformMap.sys_id);
t.setProgressName("Transforming: " + igr.number + " using map " + transformMap.name);
t.setBackground(true);
t.start();
gs.log("summary: "+ t.getOutputSummary ());
it gives me an illegal access exception. Any idea how can iii get the summary?
Regards