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:36 PM
As long as you insert the records in import set table, Transformation process will be taken care of by platform itself.
To answer your second question on sys_id, the response will be target record sys_id once you insert record in import set table. Sample script
var gr = new GlideRecord('PASS IMPORT SET TABLE');
var sys_id = gr.insert(); // I think this will return target table record sys_id.
I think line var sys_id = gr.insert(); will return target table record sys_id. Can you please test this once. Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 01:55 PM
Let me know if that answered your question. If so, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list. Thank you
How To Mark Answers Correct From Community Inbox
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2017 02:05 AM
Hi Pradeep,
i can confirm that inserting record in the import set table automatically takes care of the transforming it. But it does not return any info about the newly created record.
Regards