Transform map Null Pointer error through flow designer

Rakesh113
Tera Contributor

Hello Team, 

I am getting an error as "Error: java.lang.NullPointerException" in an flow designer Action 

Description : Right now I am looking to do transform map through the flow designer , I have successfully load the data to the data source table (like attachment , source table and transform map is attached to the data source ) , so i want to trigger this data source through the script . below is the script which i was written. when i am trying to test i am facing an error. for your reference purpose i am pasting the code as well as screenshot of the error.

 

code: 

(function execute(inputs, outputs) {
// ... code ...
var data = inputs.source.sys_id;
var dsGr = new GlideRecord('sys_data_source');
if (!dsGr.get(data))
return;
var loader = new GlideImportSetLoader(); // Please note this part of the script cannot be used in scoped apps directly. To use in scoped apps, wrap it in a script include and grant access to invoke the script include from a scoped app.
var importSetID = loader.getImportSetGr(dsGr);
loader.loadImportSetTable(importSetID, dsGr);
var importSetRun = new GlideImportSetRun(importSetID.getUniqueValue());
var importLog = new GlideImportLog(importSetRun, 'FDIH Script Step');
var transformer = new GlideImportSetTransformer();
transformer.setSyncImport(false);
transformer.setLogger(importLog);
transformer.setImportSetRun(importSetRun);
transformer.setImportSetID(importSetID);
transformer.transformAllMaps(importSetID);
})(inputs, outputs);
 
 
 
1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi @Rakesh113 

you already posted the answer in the above code example:

"Please note this part of the script cannot be used in scoped apps directly. To use in scoped apps, wrap it in a script include and grant access to invoke the script include from a scoped app."

 

So you cannot use new GlideImportSetLoader() in a scoped Flow.

 

Maik

View solution in original post

2 REPLIES 2

Maik Skoddow
Tera Patron
Tera Patron

Hi @Rakesh113 

you already posted the answer in the above code example:

"Please note this part of the script cannot be used in scoped apps directly. To use in scoped apps, wrap it in a script include and grant access to invoke the script include from a scoped app."

 

So you cannot use new GlideImportSetLoader() in a scoped Flow.

 

Maik

Hi @Maik Skoddow 

I am not using an scooped app , but I am facing an null pointer error , for your reference purpose I have attached screenshot also with error log.pleas