You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 24, 2025. It is now read-only.
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.