Call ImportSet API internally in a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 12:15 PM
Hi,
I have a script creating/updating records and i have to manually take care of the coalesce. Is there a way i can use the ImportSet API internally in a script include?
Like the postRecordStagingTable
Regards
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 12:17 PM
Hello John,
You mentioned the insert or update is via script. Are you inserting the records to import set table via script? Please confirm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 12:23 PM
Hi Pradeep,
Thanks for your time. Yes, actually the script incliude is called from a scripted REST API, and i was thinking if i could use the ImportSet API internally that will take care of all the Coalesce and mappings instead of i have to do them manually in the script.
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 12:24 PM
Hello John,
Thanks for the update. As long as your insert the records in import set tables(i.e GlideRecord the import set table instead of target table and insert a record), Transformation map will take care of coalesce and mapping. Please let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 12:31 PM
Thanks Pradeep,
I can insert the incoming values in the staging table, but how can i then trigger the transform map and get a response like the sysid of the inserted/updated records similar to the response of ImportSet API
Ref: http://wiki.servicenow.com/index.php?title=Import_Set_API
Regards