Javascript Scripting Code

  • 17 January 2023
  • 5 replies


I am trying to load some excel files and need to parse them through a script. In the javascript code I have used the xlsx libraries and it’s function, but I am not able to use it in my code. Can someone help me with this? Thank you!

5 replies

Userlevel 1

Javascript is executed using Nashorn, so it is possible to load extra JavaScript using the “load” function (, but you may need to modify the Security Manager to give it permission to load the files (


So I tried loading a file, xlsx.js as I require the xlsx library for my script.

When I am using the require function as mentioned in this blog Calling External Libraries from the JavaScript Evaluator | StreamSets

It is giving me error that the require function is undefined.

Can you kindly help me with the same



Userlevel 4



Have you updated $SDC_CONF/sdc-security.policy file and added the required permission?

// Set global perm so that JS can load scripts from this directory// Note - this means any code in the JVM can read this dir!grant {  permission "/folder/file/-", "read";};

Make sure the file is loaded on the SDC server and the path is pointing to the folder on SDC machine.

The file is loaded on the SDC server and the path is pointing to the folder as well. Still it’s not able to find the “require” function 

Userlevel 4

@groversakshi1998 is it possible to share the pipeline and a link to download this js file so that i can give it a try myself