Reference an External JavaScript File

◷ Reading Time: 2 minutes

In Natural Language, you can reference an external JavaScript file and use the functions there.

Reference the JS Function

  • In your external JS file, create the function that needs to be referenced in the Natural Language file.
  • Created JS function should be used in your Natural Language document with the same function name.
  • The same function name should be referenced in the document under Type Definition.
    • Is Function: True
    • Name: <Name of the function>

Test with JS Testbed

Reference External JS File

  • Click on JS Testbed and add your .js file.
  • It also requires selecting the option, Include External JavaScript Sources.
  • Once you see the .js file in the list, click Launch.

Run the Function in JS Testbed

  • Your logics in Natural Language will be launched in the JS Testbed as follows.
  • You can select which logic to run and enter the input data.
  • The logic will run in the JS Testbed and you will see the results as follows.

Download Project

The project explained can be downloaded from the link at the end of the page.

Updated on April 8, 2022

Article Attachments

Was this article helpful?

Related Articles