Knowledge base
Tips and tricks Best practice guides, FAQ & more
Find tutorials, guides and use case examples in the
Learning center
The Change text building block changes a piece of text by applying an operation such as “substring” (get a smaller piece of the text), “concatenate” (add two pieces of text together) among many others.
Fully expanded, the Change text block shows the following properties:
There are no green input or output connectors in the header, because this building block is never explicitly executed. Rather, it is used to change a text value and deliver the result to other building blocks.
The title of the block (“Change text”) can be changed by double-clicking on it and typing in a new title.
The original text to change.
The text can be dynamic by using tokens for added fields (see below). Right-click in the text and select “Insert token” to insert a field that has been added below.
Add any number of fields that can contain dynamic content and be used as tokens in the text.
The method to change the text using.
Get a piece of text from within the original text. This method requires two sub-properties to be filled out:
Index: The first character position in the text to start the substring operation from.
Count: The number of characters to get from the text.
Replace all occurrences of a piece of text with another piece of text. This method requires two sub-properties to be filled out:
Old value: The value to find and replace in the text.
New value: The value to replace the old value with in the text.
Concatenate (add) two pieces of text together. This method requires one sub-property to be filled out:
Text: The text to concatenate (add) to the existing text.
Change all characters from the original text to UPPERCASE.
Change all characters from the original text to lowercase.
Within the original text, find the position of the first occurrence of a piece of text. This method requires two sub-properties to be filled out:
Subtext: The value to find the index of in the text.
Occurrence: The occurrence of the value to find the index of in the text.
Within the original text, find the position of the last occurrence of a piece of text. This method requires two sub-properties to be filled out:
Subtext: The value to find the index of in the text.
Occurrence: The occurrence of the value to find the index of in the text, starting at the end and moving backwards.
Count the number of characters in a piece of text.
Remove all of the whitespace, or other specific characters, from the start and end of a piece of text. This method requires one sub-property to be filled out:
Trim characters: One or more characters to trim from the text.
Add specific padding characters to the left (front) of the text. This method requires two sub-properties to be filled out:
Pad characters: One or more characters to pad the existing text with on the left side.
Length: The desired length of the text after padding.
Add specific padding characters to the right (end) of the text. This method requires two sub-properties to be filled out:
Pad characters: One or more characters to pad the existing text with on the right side.
Length: The desired length of the text after padding.
The changed text as the result of the operation.
Updated February 1st 2017.
©2024, Leapwork. All rights reserved.