Share:

A Script node is used to write business logic depending on the app requirement. The logic is written in TypeScript in the TS editor of the Attributes window. 

How to Use

  • Open the Services editor window.
  • Click the plus icon to add a new service or open an existing service in the service list.
  • In the Nodes Palette, drag and drop a Script node to the workspace.
  • Drag and drop other nodes to create a flow. Make sure the flow always starts with a Start node.
  • After the flow is created, import the service to the application page. See Import a service to learn more.

Associated Attributes

Script node  properties
  • Name: Unique name for the node. This name will display on the service editor when you save the node.
  • Code Editor: Allows you to add the JavaScript code and write the business logic of the Script node. 

For example:

  • To call the function greet (with a string) and show a greeting message to the user, add this code: greet("hello world");
  • To create or update a bh.local property named modelrApiUrl and link it to a URL, add this code:

bh.local.modelrApiUrl = 'http://localhost:24483/api/weather';

Add your business logic using the editor and click the button.

Example

See Client-side Services Example.


Snackbar Node                                                                                                                  Switch Node  >