Please explain what is of GlideImportSetTransformerWorker API
This content was last updated in 2023. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 08:46 AM
Hi,
I was confuse of this Knowledge article. please can anyone explain In details about this article
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0781666
and what is purpose of the code below in the same article
transformAsyncIset();
function transformAsyncIset() {
var igr = new GlideRecord("sys_import_set");
igr.addQuery("mode", "asynchronous");
igr.addQuery("table_name", "STAGING_TABLE_NAME");
igr.addQuery("state", "loading");
igr.query();
while (igr.next()) {
sTransform(igr);
}
}
function sTransform(igr) {
var mapsList = getMap(igr.table_name);
var t = new GlideImportSetTransformerWorker(igr.sys_id, mapsList);
t.setProgressName("Transforming: " + igr.number);
t.setBackground(true);
t.start();
}
function getMap(sTable) {
var mapGR = new GlideRecord("sys_transform_map");
mapGR.addQuery("source_table", sTable);
mapGR.addActiveQuery();
mapGR.query();
var mapsList = [];
while (mapGR.next())
mapsList.push(mapGR.getUniqueValue());
return mapsList.join();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 09:44 AM
Hello @Mohan raj ,
Please find the below link
https://developer.servicenow.com/dev.do#!/reference/api/tokyo/server/GlideImportSetTransformerAPI
The above code is basically loading, mapping and transforming the data.
Thank you,
Omkar