Important! Read this.

We have launched a new documentation website. If you're using Enterpise Edition 10 (or higher) or Express/Business Edition 2.4.1 (or higher), visit this page.

Skip to end of metadata
Go to start of metadata

We have moved to a new documentation platform. This section is no longer supported. For the up-to-date information, see Text.

The Text actions are intended to refine the texts acquired during other actions, for example, from web-elements, remove unnecessary blank spaces, check, if the text matches the defined content, and combine several texts together.

Use case

In automated task, while the Bot extracts the information it can grab some garbage characters, which may even make the text irrelevant. In order to eliminate such cases and make the acquired text plain and correct, use the Text actions to process and refine the text.

Actions LibraryActions Description

Text Actions

You can make the following manipulations with the text acquired during the recording's steps.

Note

The variables for input and output in the Text actions are declared in the Recorder Variables section.

String Contains

When it is necessary to check, if the text contains some characters or matches to a specific mask, you can do it in the String Contains action.

Use caseThe String Contains action can be used to check, if the text acquired in the previous steps meets your requirements, and skip processing of irrelevant information.

Parameters

  • Input Variable – a string variable containing initial text to check, if it matches to the conditions defined in Options.
  • Options – conditions  to check the content of the input variable:
    • Text – enter the text, that the input variable should contain.
    • Regular expression – use the regular expressions to specify a mask for the text, that the input variable value should contain.

      Note

      For more information about the regular expressions, refer to RegexOne web-site.

  • Output – a Boolean variable, that switches to true, if the input variable contains the text that meets the conditions defined in Option, otherwise it switches to false.

Replace Text

The Replace Text action allows finding a defined text in the String variable value and replacing it with the text specified.

Parameters

  • Input – a string variable containing the text for replacement.

  • Options

    • Text to find – a text to be found and replaced.

    • Replace with – a text to be put instead of the found text.

    • Case sensitive – select the option to apply case sensitivity to the search results, i.e. to consider the letters in upper case in the search.

    • Replace all – all occurrences of the text for replacement found in the initial text are replaced with the text specified. If the option is not selected, only the first occurrence will be replaced.

  • Output – a string variable, that gets the text with replacements.

Substring

The action takes the text from a string variable and extracts only the required portion of text avoiding the other parts of the text, that are not relevant or garbage. The first and last characters and the direction to select the characters are defined for the action.

Use case

When grabbing a text from a field, the resulting text may be too long due to presence of the irrelevant information. Using the Substring function, you can select only the necessary text and remove the rest.

Parameters

  • Input – a string variable containing initial text for extraction of characters.

Options – first and last positions and the direction of selection:

  • Start character position – the position where the first required character is located.

    Note

    Counting of positions starts with 1, unlike array indexes, that starts with 0.

    • Count from end – by default the start position is counted from the first character in the text, tick the box to count the start position from the last character.
  • End character position – the position where the last required character is located.
    • Count from end – by default the end position is counted from the first character in the text, tick the box to count the end position from the last character.

Example

As an example, we will extract "EXPR" from "RPA EXPRESS":

Variant 1

Define the first and last positions by default (from the beginning of the text)

  • Start character position – 5
  • End character position – 8

Variant 2

Define the first and last positions in the inverted direction (from the end of the text)

  • Start character position – 7, Count from end
  • End character position – 4, Count from end

Variant 3

Define the first position by default (from the beginning of the text) and the last position in the inverted direction (from the end of the text)

  • Start character position – 5
  • End character position – 4, Count from end

Variant 4

Define the first position in the inverted direction (from the end of the text) and the last position by default (from the beginning of the text)

  • Start character position – 7, Count from end
  • End character position – 8
  • Output – a string variable, that gets the extracted text.

Substring Between

The action takes the text from a string variable and extracts only the required portion of text that comes after, before or between the text(-s) specified.


Parameters

  • Input – a string variable containing initial text for extraction of characters.
  • Options – first and last positions and the direction of selection:
    • Extract text after – the text that serves as a beginning for extraction. This text is excluded from the output.

    • Extract text before – the text that serves as an end for extraction. This text is excluded from the output.

Example

As an example, we will extract the web-site "automationacademy.com" from the link:

Variant 1

Extract text after: https://

Extract text before: /learn/login/index.php

Result: automationacademy.com

Variant 2

Extract text after: https://

Extract text before: empty

Result: automationacademy.com/learn/login/index.php

Variant 3

Extract text after: empty

Extract text before: /learn/login/index.php

Result: https://automationacademy.com

  • Output – a string variable, that gets the extracted text.

Trim Whitespace

If a text is copied from an external content, for example, a web-page, it may contain some non-printable characters.

Using the Trim function you can delete these white spaces, both leading and trailing, from the text to enable correct insertion into text or spreadsheet processors.

Use case

When pasting a text from the clipboard to MS Excel, the line brake shifts the selection one cell down. Consequently, after the next paste operation there will be an empty cell between the cells with the data.

The Trim Whitespace action removes leading and trailing characters such as spaces, tabs, line brakes and other non-printable characters.

Parameters

  • Input – a string variable containing initial text for trimming.
  • Output – a string variable, that gets the cleaned text.

Change Case

The action takes the text from a string variable and change the case of the letters according to the option selected.


Parameters

  • Input – a string variable containing initial text for changing the case.
  • Options – the model how to change the case in the initial text:
    • UPPERCASE – all letters change to the upper case

    • lowercase – all letters change to the lower case
    • Sentence case. – only the first letter in first word is capitalized
    • Capitalize Each Word – the first letters in all words are capitalized
    • tOGGLE cASE – case of all letters is inverted
  • Output – a string variable, that gets the text with the changed case.

Join Strings

When you need to concatenate texts from a number of string variables into one, you can do it in the Join Strings action.

Use case

The Join Strings action can be used to concatenate texts extracted from different lines, fields or pages and stored in different string variables. The concatenated output can be delimited.

Parameters

  • Input – a list of string variables to take the texts from and merge into one.
  • Options – if the resulting text should be delimited, you can choose the appropriate delimiter. The following pre-defined characters are supported to delimit the texts (alternatively you can use any other characters or texts):
    • Tab
    • Comma (,)

    • Semicolon (;)

    • Line brake (CR+LF for Windows and LF for Linux and MacOS)

  • Output – a string variable, that gets the joined text.

Split String

When you need to split a value in a string variable into list items, you can do it in the Split String action.

Use case

The Split String action can be used to create a list out of a single string, for example, extracted from a web page.


Parameters

  • Input – a string variable containing a text to be split.
  • Options
    • Separate elements with – you can choose the appropriate delimiter to split the text into list elements. The following pre-defined characters are supported to create a list from the text (alternatively you can use any other characters or texts):
      • Tab
      • Comma (,)

      • Semicolon (;)

      • Line brake (CR+LF for Windows and LF for Linux and MacOS)

    • Trim whitespace – the option removes all characters such as spaces, tabs, line brakes and other non-printable characters.
  • Output – a list variable, that gets the split text.

Get Length

When you need to determine the length of the text containing in a string variable , you can do it in the Get Length action.


Parameters

  • Input – a string variable containing a text, which length should be determined.
  • Output – a number variable, that gets the length of the text.
  • No labels