Usage of GlideImportSetLoader & GlideImportSetTransformerWorker API's from scoped Application

Arun Saravanan1
Kilo Contributor

Hi All,

We are working on a scoped application and as a part of use case would like to leverage below OOTB API's. 

  • GlideImportSetLoader
  • GlideImportSetTransformerWorker

I know it is not accessible from scoped application but can used by defining the logic in a global script include and calling it from my application. 

Since there is no documentation available for GlideImportSetLoader in the servicenow official site. As a developer are we allowed to this API's considering future support from servicenow ??

@Chuck Tomasi @Pradeep Sharma  Really need your guidance over here.

Thanks in advance.

-Arun

 

9 REPLIES 9

It will solve the purpose of transform map execution via these API's. How about loading data into import set table. 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Arun,

Let me know if that answered your question. If so, please mark my response as correct & 👍 helpful so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Arun Saravanan1
Kilo Contributor

Thanks Ankur for your response 🙂 

Any information on 'GlideImportSetLoader' API from scoped application ?

Also do we have any alternate  API or approach to load data into import set table automatically without using GlideImportSetLoader.

Regards,

Arun

Hi Arun,

not sure whether they have updated the API to support for scoped app

try checking in release notes.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Fabian10
Tera Guru

Hi buddies,

I bumped into the same issue as Arun did and I wanted to transform some data from a scoped app by using scripts.

I managed to get it working with the scripts documented here:

GlideImportSetTransformer - Scoped, Global | ServiceNow Developers

Basically I created created a new record in sys_import_set:

createAsynchronousImportSet: function(tableName) {
        var gr = new GlideRecord('sys_import_set');
        gr.initialize();
        gr.setValue('table_name', tableName);
        gr.setValue('mode', 'asynchronous');
        gr.setValue('state', 'loading');
        gr.insert();
        return gr;
    },

var importSet = this.helper.createAsynchronousImportSet('import_table_name');

 

Then I inserted all my data to the import table:

var importGr = new GlideRecord('import_table_name');
importGr.initialize();
importGr.setValue('field1', data1);
importGr.insert();

After that the following script did the job for me to transform the data:

var transformer = new GlideImportSetTransformer();
transformer.transformAllMaps(importSet);