Support for sys_script_include (Script Include) via Fluent API? #17
-
Hi team, We develop scoped application on to of servicenow platform, we utilize custom tooling to support source code development on local machine. However, we do use servicenow platform UI for the development activities that isn't "script" heavy or config type. we are experimenting with the ServiceNow SDK (v3.x) and planning to migrate on building applications entirely with source code driven by Fluent API. There are two reasons:
However, we have noticed that currently Fluent APIs are limited. One important missing piece for us is sys_script_include (Script Include). Record({ Is this on the roadmap or is there better workaround than using Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There will be a dedicated Record({
$id: Now.ID['some-value'],
table: 'sys_script_include',
data: {
script: Now.include('./my-script-file.server.js'),
...
}
}) You can then also utilize the Example of all this: |
Beta Was this translation helpful? Give feedback.
There will be a dedicated
ScriptInclude
API in the next release, but what we recommend you do in either case is to utilizeNow.include
to move the contents of that fieldscript
to a dedicated file for proper editor support and syntax.Example:
You can then also utilize the
now-sdk dependencies
command to download the typing information from your instance and add it to your project (goes into @types/servicenow folder) to get intellisense in your js files. Also add atsconfig.json
file to src/fluent to configure intellisense and typing information…