Use the Format Text component
-
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- RPA Hub
Format the text by using variable placeholders and line and tab variables with the Format Text component in RPA Desktop Design Studio. You can update the text and their positions easily by just updating the variable placeholders and the line and tab variables.
Before you begin
Role required: none
About this task
Common issues and solutions for using the Format Text Component.
- Missing Arguments
-
This issue occurs when the format string contains more placeholders than the number of arguments provided.
For example,- Format string: {0} {1}
- Arguments provided: "Hello"
- Correct Argument Placement
-
The index (zero-based) must be greater than or equal to zero and less than the size of the argument list.
Solution:
The solution is to ensure the number of arguments matches the number of placeholders in the format string. For example:
- Format String:
"Hello"
- Argument:
"World"
In this case, the format string does not contain any placeholders, so no arguments are needed. If you have a format string like
"Hello, {0}! Welcome to {1}."
, you would need to provide two arguments, such as"World"
and"ServiceNow"
. - Format String:
- Using Literal Curly Braces in Format Strings
Issue: Curly braces {} have special meaning in string formatting and must be escaped when used as literal characters.
Example of Incorrect Usage:
Format String:Error Message: An error occurred during execution. Component 'Format Text' failed to execute in the activity 'New Activity'.
- Input string was not in a correct format
- The solution is to use double braces to represent literal curly braces:Rule to remember:
{{
represents a literal{
}}
represents a literal}
You can configure the properties for the Format Text component. For more information about these properties, see Properties of the General components.
Procedure