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

Thank you!

I created custom actions for both processing the excel file and transforming the import set in Flow Designer based on one of Göran Lundqvist's videos.

 

I tried adding the following to the script within the transforming action and got the same result:

transformer.setImportSetRun(importSetRun);

transformer.transformAllMaps(importSet);  

is there some bit of code I can run to emulate clicking the Transform button within 'Specify Import set and Transform map'.  The tranform map I want to use is already in there after running my flow.  I just can't seem to get my script to automatically 'click that transform button' if you will.

If I'm understanding your query correctly, you're wanting to specify the map(s) to use? If so, you can use the setMapID function

 

The transform action i'm using in the workflow already has the transform map I want to use set.  After I run the workflow, I open the new 'loaded' import set, and then click on Transform (at this point I'm in the 'Specify Import set and Transform map' section) I see the transform map that I specified within "Selected maps, run in order".  All I want is for my workflow to hit run the transform so that I don't have to take the aforementioned steps and click the Transform button within "Selected maps, run in order".

It appears that my workflow is identifying the right transform map.  I just can't code the custom action to actually run the transform.

So to actually kick off the transform, you can do something like this:

 var t = new GlideImportSetTransformer();
          t.setMapID(map.sys_id);
          t.transformAllMaps(importSetGr);

So overall your script might look like:

function LoadAndTransform(/* Data Source */ source, /* Transform Map */ mapName, /* Delete Transform Map */ cleanMap) {
	
	//Get our data source by its name
	var sourceGr = new GlideRecord('sys_data_source');
	sourceGr.addQuery('name', source);
	sourceGr.query();
	// if we have our data source continue
	if(!sourceGr.next()) {
		gs.print('Did not find Data Source ' + source);
		return;
	}

	//Find the name we want to use by its name
	var map = new GlideRecord('sys_transform_map');
	map.addQuery('name', mapName);
	map.query();
	// if we have a map we can now load and run the transform
	if(!map.next()) {
		gs.print('Did not find Transform map ' + mapName);
		return;
	}

	//Load in the data ready for it to be transformed
	gs.print('Loading Import Set ' + source);
	var loader = new GlideImportSetLoader();
	var importSetGr = loader.getImportSetGr(sourceGr);
	var ranload = loader.loadImportSetTable(importSetGr, sourceGr);

	if(!ranload) {
		gs.print('Failed to load import set ' + source);
		return;
	}

	//Set the map(s) we want to use and run the transformation
	gs.print('Running Transform map ' + map.name);
	var t = new GlideImportSetTransformer();
	t.setMapID(map.sys_id);
	t.transformAllMaps(importSetGr);

	// Optional - Clean up Import
	var cleaner = new ImportSetCleaner(importSetGr.table_name);
	cleaner.setDataOnly(true);
	cleaner.setDeleteMaps(cleanMap);
	cleaner.clean();
}

Hi, 

I am also experiencing the same issue while loading the transforming the data using the GlideImportSetTransformerWorker API. 

Want to know if you had a luck to find the cause and fix the issue? If yes, please share the solution?

Thank you in advance.