How to insert the record in Import Sets table using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2020 01:47 AM
Hi All,
I want to get record using import set and I want to do it using a script,
so I have used the below script and its interesting the record but its not processing and pulling the data.
Please guide me where i need to change the script.
Inserting record in 'sys_import_set' table
var imp = new GlideRecord('sys_import_set');
imp.initialize();
imp.state = 'loaded';
imp.data_source = '0e2d4f4cdba690d06d438a3a489619e2';
imp.table_name = 'u_get_external_user';
imp.insert();
Records get inserted but is not processing
Thanks
Ramesh R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2020 01:56 AM
Hi,
You can try dataSourceImportUtils() to schedule a loaded import.
For ex:
/* Schedule Loaded import*/
var res=new global.dataSourceImportUtils().scheduleImport(dataSourceID, transformMapIDs);
var schRec=new GlideRecord("sys_trigger");
schRec.get('sys_id',res);
//gs.log('Transform map result next '+res +' '+schRec.getValue('next_action'));
workflow.info('Import schedule ('+res+') has been scheduled at '+schRec.getDisplayValue('next_action'));
Hope this helps!
If I have answered your question, please mark my response as correct and/or helpful.
Thanks,
Suseela P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2020 02:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2020 01:56 AM
Hi,
I have a doubt,Why you are not creating a data source & uploading the excel sheet?
You also have option to run transform script.
Thanks
Sudhanshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2020 02:07 AM
Hi
I am not updating excel sheet, i am pulling the record from LDAP using existing data source
Thanks
Ramesh R