Wanting to Import data using external REST service on a schedule using Import Set / Transform Map
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2012 07:59 AM
We're running into an issue where right now we are using Scheduled Jobs to kick off a script include that uses a MID Server to connect to a 3rd party system for importing data into a ServiceNow table directly. What we want to do is use Import Sets and Transform maps also, so that we aren't pulling for 3rd part software using REST and entering data directly into the tables using the script.
With that said, we are stuck on figuring out how exactly how to "Load Data" into the import set and then kicking off then "Run Transform". We know the transform map needs to be asynchronous and that if we were using odbc, file, xml, we would go the Import Sources route, but we can't. Have to be ServiceNow scheduled import using MID server to consume the REST services.
Any help would be appreciated.
- 26,832 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2018 06:56 PM
It's possible for it to be in both places. It should take you to the sys_trigger table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2018 10:16 AM
Hi ChrisB,
Can u update ur this piece of information according to london version as I am not able to edit sys_import_set.do which u have mention in step 3.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2018 01:09 PM
Hi nikita,
A few posts above yours between tantony and myself answering rishi4200's posted issue (which may be the same issue you're facing where the fields are read only) we give you about four different ways to do step 3.
Keep in mind though there are also many other .updated posts within this thread may help as well and are more recent than mine.
But here are the different ways I listed of doing step 3 again:
1) Use the Scripts-Background to simply update the data for the specific fields that need updating
2) Use a server side script to make your changes
or
3) Change the setting in the dictionary entry of the field(s) to not be read only. Then you should be able to write to the fields manually.
And @tantony's suggestion:
You can also create an import_set entry programmatically in the Scheduled job script
var impSet = new GlideRecord('sys_import_set');
impSet.initialize();
impSet.mode = 'asynchronous';
impSet.table_name = 'u_your_import_table';
impSet.state = 'loading';
impSet.insert();
Make sure you set the "mode" according to your needs
I hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2018 12:32 AM
Hi ChrisB,
Thanks again.One more query,what if we want to run schedule for more than one table.As in sys_import_set we can provide only one table name in import set table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2018 07:53 AM
You should be able to leverage the script in the scheduled job to handle multiple tables