edoc automate Guide
Breadcrumbs

script\ExecJavaScript - edoc automate

The ExecJavaScript action executes the specified JavaScript code in the client.

You can use placeholders in the JavaScript code that are replaced at runtime by a static value or the return of an action.

Syntax: :<param-name>
Example: var id = :value

Options for parameters

You can affect the behavior of the parameter substitution with additional options for the parameters. You can insert the options with square brackets after the parameter name. Example: :<paramname>[<options>] If you want to use several options, you can separate them with a comma.

By default, all parameters are automatically replaced with enclosing quotation marks if required. Numbers and null are inserted without quotation marks. You can use the QUOTES and NO_QUOTES options to control the addition of quotation marks around the parameter values.

  • QUOTES The parameter value, except null, is inserted with quotation marks. *

  • NO_QUOTES The parameter value is inserted without enclosing quotation marks. Please note the safety instructions!

The following options are also available:

  • DEFAULT Specifies a value that is used if the parameter value is null.

  • ISEMPTY Specifies a value that is used if the parameter value is empty.

  • ISSTRING Specifies a value that is used if the parameter value is a string.

  • ISNUMERIC Specifies a value that is used if the parameter value is a number.

Example: :param1[QUOTES,ISEMPTY:Default value]

You can replace the placeholders in the ExecJavaScript action with Dataset actions, e.g. DatasetFromCSV and DatasetFromJSON. The values are returned in JSON format.

Using NO_QUOTES and QUOTES can lead to potential JavaScript security vulnerabilities (including cross-site scripting (XSS) attacks). If you use the option anyway, make absolutely sure that the parameter values are validated by the app and masked if necessary to avoid potential security vulnerabilities in your app.

Parameters

Type

Name

Description

EDITOR

code

Specifies the JavaScript code to be executed.

Return

None