Upload data with an excel file through record producer

Chaitanya Redd1
Tera Guru

Hello Team,

I'm trying to upload data through excel file using record producer but it's not working with below script. It's  redirecting to data source I can see that excel file not got loaded.

var transformMapSysIDs = 'dda3bc40dbd69050e8848f104a96193d';
current.name = gs.getUserName() + " UserImport at: " + new GlideDateTime();
current.import_set_table_name = 'u_r2p_rework_data_load'; //Name of your import table
current.file_retrieval_method = "Attachment";
current.type = "File";
current.format = "Excel";
current.header_row = 1;
current.sheet_number = 1;
current.insert(); 
 
 
var loader = new GlideImportSetLoader();
var importSetRec = loader.getImportSetGr(current);
var ranload = loader.loadImportSetTable(importSetRec, current);
importSetRec.state = "loaded";
importSetRec.update();
 
 
var transformWorker = new GlideImportSetTransformerWorker(importSetRec.sys_id, transformMapSysIDs);
transformWorker.setBackground(true);
transformWorker.start();
//To avoid to create another data source we abort the RP insert.
current.setAbortAction(true);
 
Can anyone help me where I went wrong in this script. Record producer & Transform map is on Global.
 
Thanks,
Chaitanya
12 REPLIES 12

Hi,

if that is custom one then you need to check what got changed from yesterday and today.

Did you check

1) transform map sys_id is valid

2) Transform map is present in instance

3) Somebody updated some field maps in that transform map

Regards
Ankur

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

Onkar Pandav
Tera Guru

Hi,

Also check below video link that might be useful.

Upload data with excel file and record producer

Let me know if it helps.

Hi Onkar,

I have tried using same method but didn't worked.

Thanks,

Chaitanya

Ok.

So may be @Göran Lundqvist can help you on this.

Hi,

Take a look at my video here: Episode 16 - Upload data with an excel file and Record producer in ServiceNow - YouTube

//Göran
Feel free to connect:
LinkedIn
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor's Guide To ServiceNow