- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2014 01:09 PM
I'm working on integration and successfully loaded data in import set table via REST API call for third party product. Since SOAP/REST transforms data in synchronous mode by default so I wanted to change the mode of the import set transform. I'm using schedule script to call the REST API method and loading data in ServiceNow import tables.
Regards
Bhupinder
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2015 07:28 AM
Correct missed a function. But here is full piece-
var CreateAsynchImportSet = Class.create();
CreateAsynchImportSet.prototype = {
createImportSet: function(tableName,description) {
var isgr = new GlideRecord("sys_import_set");
isgr.initialize();
isgr.mode = "asynchronous";
isgr.state = "loading";
isgr.table_name = tableName;
isgr.short_description = description;
var is_id = isgr.insert();
return isgr;
},
setStateTransform: function(setId) {
//Mark the import set as Loaded
setId.state = "loaded";
setId.update();
// transform the import set
var t = new GlideImportSetTransformer();
t.transformAllMaps(setId);
return setId.state;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2015 10:43 AM
So I have been playing with GllideImportSetTransformer and it works perfectly... as long as you are in the Global scope. It does not work for scoped applications. I am starting to lose faith...