Import Set stuck in 'Loaded' state

charliesdev
Giga Expert

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?

9 REPLIES 9

sachin_namjoshi
Kilo Patron
Kilo Patron

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

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?

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!

You can use the GlideImportSetTransformer API to run a transform map.