Skip to content
This repository was archived by the owner on Aug 24, 2025. It is now read-only.

Postback to SN Instance

Richard Szolár edited this page Dec 17, 2019 · 3 revisions

Due to the nature of the code being executed inside the hosted VM, we will need a way to post back the results to the execution log.

For this purpose, I created an internal _getLogID() function inside the VM which can be used by scripts created on the ServiceNow Instance.

You can use this function basically anywhere inside your script. This function returns a sys_id of the log entry in the execution log.

We can run code synchronously or asynchronously. We do not know when an asynchronous function will end, so the REST API can not wait for code execution. You should always use the postback function to get the results if running NodeJS scripts, otherwise the results will be empty.

Please refer to the reusable helpers (amongst others, also postback functions) on the scoped-app repo for more information.

Clone this wiki locally