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.

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.

1.2. String settings panel

It consists of the following elements:

  1. ;
  2. ;
  3. Method;
  4. ;

  5. Break;
  6. Add limit.

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

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;

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

1.2.5. Break

Responsible for the completion of the flow execution.

- initiates the end of the flow execution after the given component.

- the switch is in the off position.

1.2.6. Add 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 .

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.

Fig. 2. Setting a limit