Is there a way to reprocess Import API records?

peterraeves
Mega Guru

We created an Import Set API and made is very restrictive. Only when everything is entered correctly by the correct user, it goes through. Though sometimes we want to reprocess the record after a change was made. What would the easiest way be to reproduce a record on an Import Set API table?

What we do now, is to go to the REST API Explorer and send the information as the user that sent the information. This process is manual and error prone, so is there a better way?

We are thinking of creating a button 'Reprocess', which removes the meta data, and creates a copy. Or might there be a better way? Is there no OOTB way to reprocess such records?

17 REPLIES 17

1. The solution has been working quite good. The only issue that I have is that the new record is created by myself and not by the same user as the original record.

2. Yes

3. It does not have to be processed. Import set API import sets are usually left to 'Loading' for a while and it works just fine while it is not processed.

4. Instant

Not sure if relevant, but I have only used the ui action on import set rows which consist of request from services coming in from import set apis. Thus only for rows of synchronous import sets. I haven't tested for rows in async import sets. So not sure how the ui action would fare there.

DorianK
Tera Expert

I know this is an old thread, but I thought I would help out someone in case they came searching for a solution like me.

 

It looks like there is now a method to re-process a single method via a script.

 

Example:

 

 

 

//get the import set
var importSet = new GlideRecord('sys_import_set');
importSet.get('ec85458bdbd27510f71c4eac139619e2');
//use the transformer api
var transformer = new GlideImportSetTransformer();
//call the transformAllMaps with the specific row you want to process
transformer.transformAllMaps(importSet,'8585858bdbd27510f71c4eac1396190b');
//note: you will need to set the individual row back to pending before calling this.

 

 

API: https://developer.servicenow.com/dev.do#!/reference/api/utah/server/no-namespace/GlideImportSetTrans...