Including external js library

axelbest
Kilo Contributor

Hello,
is there a way to include an external js library into servicenow instance? I need  to include a pdf making library. 

Just to be clear: i need this library mostly in the backend part of s-now (business rules, script includes, server side...), so i've already found a lot of ways to include a js file - but only on the front-end purposes (portal, ui-actions..).

Some libraries might be installed with npm tool (in normal non-servicenow websites), but is there a way to do this kind of thing on servicenow?

1 ACCEPTED SOLUTION

DScroggins
Kilo Sage

I believe you can only include external libraries using UI Scripts and those would only be available on the client side. Im not aware of a way to include them for use on the server side.

View solution in original post

5 REPLIES 5

DScroggins
Kilo Sage

I believe you can only include external libraries using UI Scripts and those would only be available on the client side. Im not aware of a way to include them for use on the server side.

Joseph Gabriel
Tera Contributor

You can add 3rd party JS libraries to use on server-side script by adding the library as a Script Include.  This is not practical for large libraries with a lot of dependencies, but it works fine for single-file libraries, such as MomentJS, etc.

alebuc
Tera Expert

Hi @axelbest@o2,

 

sorry to bother you. Can you tell me more about:

"so i've already found a lot of ways to include a js file - but only on the front-end purposes (portal, ui-actions..)."

I am also trying to integrate external libraries into ServiceNow, both client and server side. All I know is that you have to copy the libraries into script includes or ui scripts, but this requires processing and adaptation of the script. Did you find any other way by chance, maybe more easy?

 

Thanks,

Alessio

Ed1
Kilo Contributor

Still no solution to do it easily?

 

I would like to use a library that has also some dependences so i cannot copy all myself, would not be practical at all.