Import Set stuck in 'Loaded' state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2019 04:55 AM
I know there are a lot of articles out there about being stuck in the 'Loading' state, but my Import Sets are 'Loaded'. If i open the Import Set there is a related link for 'Transform'. When I click that, the data comes in with no error.
What is causing this hang-up and how do I get Import Sets to automatically Transform and finish the import?
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2019 09:46 AM
You can process a data source by the following script:
// Process excel file
var loader = new GlideImportSetLoader();
var importSetRec = loader.getImportSetGr(DATA-SOURCE-GLIDERECORD);
var ranload = loader.loadImportSetTable(importSetRec, DATA-SOURCE-GLIDERECORD);
importSetRec.state = "loaded";
importSetRec.update();
Then you can transform the data from that data source specifying the SysID of the transform map to utilize:
// Transform import set
var transformWorker = new GlideImportSetTransformerWorker(importSetRec.sys_id, TRANSFORM-MAP-SYSID);
transformWorker.setBackground(true);
transformWorker.start();
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2019 12:33 PM
Thank you for the reply. Yes, this code looks familiar, I use something like that for other scheduled imports.
But when I try it in my current implementation (a Scripted REST Resource), I get an exception "GlideImportSetTransformerWorker is not allowed in scoped applications". Yikes, really?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2021 08:31 AM
The Service Now instance I'm using is Quebec.
I'm basically using this exact script but the state of the import set remains "Loaded". If click into the import set and click Transform, I see where the Transformation Map I want to use is listed, all I need to do is hit Transform again. What can I add to this script that will function as the 'Transform' button?
Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2021 08:49 AM
You can use the GlideImportSetTransformer API to run a transform map.