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 02:07 AM
Can you explain the requirement on this?
Ideally you won't trigger it in this way. Probably you will have to insert record into your staging table via
GlideRecord and it would trigger the transform the record.
Regards
Ankur
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-2020 02:11 AM
Hi
I have to pull the record from the LDAP server using a data source.
I have a data source and a transform map. but the issue is don't want to do this using data scheduled, so I want to directly interest record into 'sys_import_set' table with the data source and staging table name
Please let me if any other way
Thanks
Ramesh R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2020 02:33 AM
Hi Ramesh,
So basically you want to trigger the LDAP pull only when you want i.e. at particular time.
How are you currently triggering that? Is it via some schedule job?
If you want to trigger the LDAP pull at particular time like once a week etc you can have schedule job and trigger the transform as well
Regards
Ankur
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-2020 03:13 AM
Hi,
Yes, currently it's pulling the record using the scheduled job, and whenever a scheduled job is running its interesting the record in the import set table (sys_import_set) then the automatically transform map is running and inserting the data,
But instead of the scheduled job directly I am trying to insert record in the import set table with all details (like data source and transform map), for that only I am using the about script.
but its not processing properly
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2020 04:27 AM
Hi Ramesh,
I believe from schedule job you might be inserting record into the staging table and hence transform is triggering.
Possibly provide some more details
Please check below link for more help
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader