Run Auto Transform Map when RP submitted excel file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 06:03 AM
Hi,
I am trying to set up Auto run transform map when any user submitted record producer as attachment excel data to load to the target table.It should run the auto transform map and load data to target table.
in following code i am trying it in my PDI but failed to run Auto transform map.I can see excel sheet attached to data sources first part of code is running but failed in loader part.Is this functionality still using in ServiceNow ?
var transformMapsysID = 'sys_id'; (trnasform map sysid)
current.name = gs.getUserName() + "UserImport at: " + new GlideDateTime();
current.import_set_table_name = 'u_import_record_producer';//Name of Import Set Table
current.file_retrieval_method = "Attachment";
current.type = "File";
curent.format = "Excel";
current.header_row = 1;
current.sheet_number = 1;
current.insert(); //Need this since we want to load and transform directly
//Now it time to load the excel file into the import table
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,transformMapsysID);
transformworker.setBackground(true);
transformworker.start();
--------------------------------------------
Please suggest,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 11:56 PM
unless you share what did you start and where are you stuck, we won't be able to help you.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
