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-01-2023 06:10 AM
check these links for GlideImportSetLoader
Response from fabian in this link
Usage of GlideImportSetLoader & GlideImportSetTransformerWorker API's from scoped Application
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 12:04 AM
Hi Ankur,
You mean this is not working in scope application and record producer.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 08:03 AM
Did you check that link?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 11:51 PM
Yes I checked however i am not getting exact context on that.