Use special characters

RPA Studio considers the following characters as special characters: {, }, [, ], *, and "

You can use them in:

If you want to use special characters, you have to let the Bot know that it should treat these characters as part of the string. This is called "escaping".

To escape special characters, enclose them in double quotation marks ".

Keep the following rules in mind:

Rule 1: You can escape characters individually, or you can escape entire strings

To use Tric*ntis, you can either enter Tric"*"ntis or "Tric*ntis".

This only applies if the asterisk is part of the string and not used as a wildcard.

Rule 2: The special character " needs additional escaping

The special character " requires two types of escaping:

  • Double quotation marks to escape a special character

  • An additional leading double quotation mark to indicate that the following " is the actual string and not the end of an escaped string

For instance: To work with the value {"ILoveMyBot"}, you need to enter "{""ILoveMyBot""}".

  • The " in the beginning and the end escape the entire string, including the special characters {, }, and ".

  • The " tells the system to treat the subsequent " as a string.

Escaping special characters: Write {"ILoveMyBot"} into a text box

Rule 3: { and } in the Module Set Buffer need additional escaping

The Module Set Buffer of the RPA subset allows you to create Buffers, i.e. save values that you want to use later on.

To create a Buffer whose value contains { and/or }, add two additional sets of double quotation marks to the start and the end of the string.

For instance, to create a Buffer with the value {Hello}, enter """{Hello}""" into the Value field.

This additional escaping only applies to the value of the Buffer in the Value field.

To check this value in Control Expressions or Cases, one set of double quotation marks is enough (see the example below).

In this example, you want to create a Buffer with the name SpecialCharacter and the value {ExampleValue}.

At a later time, you want to check whether the value of this Buffer is still {ExampleValue}. Depending on the outcome, the Bot should perform different actions.

To do so, you follow the steps below:

  1. Create a Step out of the Module Set Buffer, which is part of the RPA subset.

  2. Change the name to SpecialCharacter and enter the value """{ExampleValue}""".

Step Set Buffer with escaped value

  1. Add an IF Statement to your Bot.

  2. Enter the Control Expression{B[SpecialCharacter]} == "{ExampleValue}" to check whether the value of the Buffer SpecialCharacter is [ExampleValue].

Escaping special characters in a Control Expression

At run-time, the Bot creates the Buffer and performs a Group of Steps (which are not relevant to this example).

Next, the Bot checks the value of the Buffer in the IF Statement.

Depending on the outcome of the check, the Bot then performs different actions.

Was this information helpful?

Tricentis RPA Studio Manual 2020.2 © Tricentis GmbH