---
schema_version: "1"
id: 88fa74de8dbc67a0aaf37ae092816b6a64461dd28e1e30b573120a18e5cb7f10
title: Combine Strings
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/rpa-builder/6.6/toolbox-variable-handling-combine-strings.md
canonical_url: https://docs.mulesoft.com/rpa-builder/6.6/toolbox-variable-handling-combine-strings
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 4e8b123573ebf2069ce3b52fb64f655f0842c831bde9e299969de88262ab465e
description: MuleSoft Documentation Site
release: "6.6"
latest: false
---
---
product: RPA Builder
version: 6.6
---

# Combine Strings

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Use **Combine Strings** to combine multiple variables into a single new variable. This action step
supports Script variables, environment variables, and Pin variables. You can insert text before,
after, and between variables.

Link the Pin variables to use with this action step before opening the wizard. Combine Strings
supports a maximum of 5 Pin variables.

To define a single text value as a variable, use the Set Variable action step instead.

## Properties

**Pattern Text**: Defines the sequence in which variables and texts are concatenated.

## Inbound Variables

**Pattern**: Defines the sequence in which variables and texts are concatenated.

## Outbound Variables

**Combined String**: The combined strings stated as a single string, as defined in **Pattern Text**.

## Reserved values

Because Pin variables use the syntax `{<number>}`, Combine String replaces values such as `{1}` and
`{2}` with the corresponding Pin variable or an empty value if there are no variables configured in
these slots.

To use a string that contains `{1}` or other reserved value as part of the text, define a variable
containing the string and then reference it in the pattern.

For example, consider the following Pin variables:

- `{1}: Workflow Based Variables.constantString`, with value `Value {1} is:`

- `{2}: Workflow Based Variables.variableNumber`, with a numeric value defined at runtime. For this
  example, assume the value is `123456`.

By setting the pattern text to: `{1} {2}`, the combined string result is `Value {1} is: 123456`.

## Wizard

The wizard contains the editable **Pattern** text field, drop-down lists of script and environment
variables, and links to the Pin variables.

Clicking the name of a variable from the list adds a reference to the variable in the text field.
You can also enter custom text into the **Pattern** field.

Clicking variable names in the **Insert Available Variables** section of the Wizard inserts
variables into the pattern using the following syntax depending on the type of variable:

- Pin variables: `{[number in the list of all Pin variables]}`. Example: `{1}`.

- Environment variables: `%[name of variables]%`. Example: `%SYSTEM%`.

- Script variables: `($[name of variables])`. Example: `$myVariable`.

The Pin variable _Combined String_ contains the result in the form of a single string.

### Example

The macro `{1}` is bound to variable _ActivityParameters.ap\_alpha1_ and macro `{2}` is bound to
variable _ActivityParameters.ap\_alpha2_. The following table represents the values of both
variables and how they translate to a new variable using different pattern texts:

<table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th><strong>ActivityParameters.ap_alpha1</strong></th><th><strong>ActivityParameters.ap_alpha2</strong></th><th><strong>Pattern Text</strong></th><th><strong>Output Variable <em>(Combined String)</em></strong></th></tr></thead><tbody><tr><td><p><code>mulesoft</code></p></td><td><p><code>com</code></p></td><td><p><code>www.{1}.{2}</code></p></td><td><p><code>www.mulesoft.com</code></p></td></tr><tr><td><p><code>mulesoft</code></p></td><td><p><code>Info</code></p></td><td><p><code>www.{1}.{2}</code></p></td><td><p><code>www.mulesoft.info</code></p></td></tr><tr><td><p><code>Ms</code></p></td><td><p><code>Miller</code></p></td><td><p><code>Dear {1}. {2},</code></p></td><td><p><code>Dear Ms. Miller,</code></p></td></tr><tr><td><p><code>Mr</code></p></td><td><p><code>Johnson</code></p></td><td><p><code>Dear {1}. {2},</code></p></td><td><p><code>Dear Mr. Johnson,</code></p></td></tr><tr><td><p><code>Lorem</code></p></td><td><p><code>Ipsum</code></p></td><td><p><code>{1}{2}</code></p></td><td><p><code>LoremIpsum</code></p></td></tr><tr><td><p><code>Lorem</code></p></td><td><p><code>Ipsum</code></p></td><td><p><code>{2}{1} - {1}{2}</code></p></td><td><p><code>IpsumLorem - LoremIpsum</code></p></td></tr></tbody></table>

## See Also

[Set Variable](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-variable-handling-set-variable)
