Call ImportSet API internally in a script

thisisauniqueus
Giga Expert

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

find_real_file.png

Regards

7 REPLIES 7

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello John,



You mentioned the insert or update is via script. Are you inserting the records to import set table via script? Please confirm.


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


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.


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



find_real_file.png


Ref: http://wiki.servicenow.com/index.php?title=Import_Set_API



Regards