How to set parameters

The concept of setting parameters in activities

Activities contain parameters of different forms including fields, drop-down lists, checkboxes, radio buttons and simple buttons.

Required parameters are marked with a red asterisk.

For more details please look at the corresponding 'Activity Description' section.

Some typical examples with their explanations are considered below.

Setting a certain value

A majority of activities will need a certain value set to a parameter. For example, the 'Append file' activity requires a specified file path and text to add. Also, the 'Assign value to variable' activity requires an assigned value to the specified variable. In most cases to set a value, a user chooses one of the following options: 'Set a value', 'Save the previous step result' or 'Calculate a value'. Let's look more closely at what these options represent.

Set a value

Any data in the field is interpreted as either a string or a number

If the 'set a value' option is chosen, then everything that will be typed into the field will be taken as a string or as a number. For example, if a user types City "New York" to the field, then this will be processed as a string. On the other hand, if a user types something like 123, then this will be processed as a number. Additional examples are provided in the table below.

Input

Type

Output

831

Number

831

Contragent name

String

"Contragent name"

831 + 210

String

"831 + 210"

true

String

"true"

"Today is " + new Date()

String

"\"Today is \" + new Date()"

[1,2,3,4].filter( x => x > 2)

String

"[1,2,3,4].filter( x => x > 2)"

Save the previous step result

Takes what the previous activity in the algorithm returns as the value

If the 'Save the previous step result' option is selected then the value will be what the previous activity in the algorithm returns (if the previous activity returns no result then nothing will be taken as the value). For example, if the 'Read emails' activity is used, then the 'Assign value to variable' activity is added automatically, with the 'Save the previous step result' option enabled to store the emails.

Save the previous step result

Calculate a value

The variables take the value obtained according to the JavaScript rules

If the 'Calculate a value' option is selected, then the variable will be of the type that is obtained at the moment of assignment. JavaScript syntax rules must be followed.

For example, if true is assigned to a variable contragent_exists, then the variable will be logical. If "City New York" is assigned to a variable city, then it will become a string.

The table below shows the results for the same input data as in the table in the 'Set a value' section.

Input

Type

Output

831

Number

831

Contragent name

Undefined

Error "Unexpected identifier"

831 + 210

Number

1041

true

Logical

true

"Today is " + new Date()

String

"Today is Thu Jul 04 2019 17:41:35 GMT+0300 (MSK)"

[1,2,3,4].filter( x => x > 2)

Array of numbers

[3,4]

You can also use external JS libraries - lodash and moment.js.

Single fields

Some activities contain only one parameter with a field to input data. For example, in the activities such as 'If..then', 'Execute js code', and 'Do-while loop', it is required to type a JavaScript code. See more details in the 'Activity Description' section.

Also, in the 'Subprogram' activity there is a single field, but a user can not input a JavaScript code. A simple string must be used to specify the subprogram path.