Webitel: Documentation

String

1. Description

Allows various actions with strings.

This component is present in flow types like:

  • Voice;

  • Chat;

  • Forms;

  • Service.

The block (Fig.1(1)) is used in space to build the Flow. The settings panel for this component opens (Fig.1(2)) when you click on the block.

String.png

Fig.1. String component

1.1. String block

The block consists of the following elements:

  1. The name of the component;

  2. In branch — receiving (connecting with the previous block) branch;

  3. Out branch — outgoing (connecting with the following block) branch. When hovering over the Out field, a switch appears. The switch allows this component to be connected to a component that already has a connection.

The presence of an Screenshot 2024-11-07 154742.png icon indicates that the switch is on, and this component can be connected to a component that already has a connection.

Changing the switch position removes the outgoing branch of this component.

The Screenshot 2024-11-07 155145.png button deletes the block from the Flow Schema.

1.2. String settings panel

It consists of the following elements:

  1. Set result to variable;

  2. Expression;

  3. Method;

  4. Function arguments;

  5. Break;

  6. Limit;

  7. Add description.

1.2.1. Set result to variable

Here the name of a new variable is entered into which the result will be written.

1.2.2. Expression

Here you enter a variable with which you need to do actions.

1.2.3. Method

It is designed to select a method of actions. The following options are available:

  • length — returns the length of a string;

  • indexOf — returns the index of the first occurrence of the entered value in the String object on which it was called. Returns -1 if the value is not found;

  • search — searches the string for the entered value and returns the position of the match. The search value can be a string or a regular expression. This method returns -1 if no match is found;

  • slice — extracts text from one line and returns a new string;

  • substring — similar to slice. The difference is that a substring cannot accept negative indices;

  • substr — similar to slice. The difference is that the second parameter specifies the length of the extracted part;

  • replace — replaces the entered value with another value in the string;

  • toUpperCase — the string is converted to upper case;

  • charAt — returns the character at the specified index (position) in the string;

  • charCodeAt — returns the Unicode character at the specified index in the string;

  • split — the string can be converted to an array using the split function;

  • reverse — reverses the provided string;

  • base64 — base64 encoder/decoder;

  • MD5 — calculates a digest from a string using the MD5 algorithm;

  • SHA-256 — calculates the digest from the string using the SHA-256 algorithm;

  • SHA-512 — calculates the digest from the string using the SHA-512 algorithm;

1.2.4. Function arguments

Here you can enter an argument that is required for some methods.

1.2.5. Break

Responsible for the completion of the flow execution.

  • image-20250627-120834.png — initiates the end of the flow execution after the given component.

  • image-20250627-120816.png — the switch is in the off position.

1.2.6. Limit

It is intended to determine the maximum number of passes through this component.

The failover branch appears in the edited component when the limit is set image2024-1-26_12-1-12.png .

The failover branch will be used if more passes are passed through the component than entered in the Max field.

Clicking on the Add Limit button adds a Max field and a Delete limit button.

The number of possible passes is indicated in the Max field.

Clicking on the Delete limit button removes the limit and returns the Add limit button.

Limit.png


Fig. 2. Setting a limit

1.2.7. Add description

When you click the Add description button, a Description field and a Delete description button will be added.

The Description field is used to add comments to the component.

Clicking the Delete description button removes the description field and brings back the Add description button.

Description.png

Fig. 3. Add description