Skip to main content

Modified Java Script

Description

Modified Java Script provides an expression-based interface for writing and executing custom JavaScript code within a workflow. Use this step when you need flexible data transformations, string manipulation, or conditional logic that goes beyond what built-in steps offer — for example, parsing complex strings, building JSON objects, or implementing custom validation rules. It supports multiple scripts per step and provides direct access to input fields as JavaScript variables. For performance-critical operations, consider using the User Defined Java Class or User Defined Java Expression steps instead.

Configurations

Tree ViewDescription
Java Script Functions SectionThis section provides a tree view of your available scripts, functions, input fields and output fields.
Transform ScriptsIt displays a list of scripts you have created in this step
Transform Constantsa list of pre-defined, static constants including SKIP_WORKFLOW, ERROR_WORKFLOW, and CONTINUE_ WORKFLOW
Transform Functions*It contains a variety of String, Numeric, Date, Logic and specialized functions you can use to create your script. To add a function to your script, simply double-click on the function or drag it to the location in your script that you wish to insert it.
Input FieldsA list of inputs coming into the step. Double-click or use drag and drop to insert the field into your script.
Output FieldsA list of outputs for the step.
Java Script Section
This section is where you edit the script for this step. You can insert functions, constants, input fields, etc. from the tree control on the left by double-clicking on the node you wish to insert or by ragging the object onto the Java Script panel.

Note: If you comment out the Alert method (//Alert () ) in the step, then the workflow will not validate the alerts even if Alert inspection rule is configured in the AutomationEdge portal. For details about Inspection Rules, see Inspection in the AutomationEdge User's Guide.

There are two versions of the javascript engine: the 2.5 version and the 3 version. If "compatibility mode" is checked (and by default it is), javascript works like it did in version 2.5. Obviously the new version should be used if possible so uncheck "compatibility mode" if yo u can.
Fields Section
The Fields table contains a list of variables from your script including the ability to add metadata like a descriptive name.
ColumnDescription
Field NameVariable Name
Rename toRename
TypeString, Date, Boolean, Integer, BigNumber, Binary, Timestamp, Internet Address
LengthSpecify the length,

- For Number: Total number of significant figures in a number;

- For String: total length of string;

For Date: length of printed output of the string.

PrecisionNo. of digits after decimal. Specify the precision,

- For Number: Number of floating point digits; For String, Date, Boolean: unused.

Replace value ‘Fieldname’ or Rename to’Select Y/N to accept ‘Rename to’.
Buttons
Get Variables buttonRetrieves a list of variables from your script.
Test script buttonUse this button to test the syntax of your script.

*Transform Functions: Transform functions are broadly classified as below,

FunctionDescription
String FunctionsThis has several JavaScript String functions.
Numeric FunctionsThis has several JavaScript Numeric functions.
Date FunctionsThis has several JavaScript Date functions.
Logic FunctionsThis has several JavaScript Logic functions.
Special FunctionsThis has several Contains a mix of utility functions.
File FunctionsThis Category has several, functions that do simple verifications or actions related to files and folders—for example, fileExist() or createFolder().