# Split Data

The **Split Data** building block allows you to break a value into multiple parts and save them into separate columns or variables.

#### How It Works

* **Value to split** – Select the value that should be split (e.g., a full name or an address).
* **Separator** – Define the character or text that separates the parts (e.g., a space, comma, or custom delimiter).
* **Positions to save** – Specify which parts to extract and where to store them.

#### Example: Split full name to first and last name

Consider this to be your initial table:

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2FFmrCd0dszAvYOpHCUXAO%2FScreenshot%202023-06-16%20at%2017.10.57.png?alt=media&#x26;token=2368828f-4949-488f-b8af-87d9a3efbd5e" alt=""><figcaption></figcaption></figure>

How to set up the Split Data building block:

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2F6N93HCLGuuymyNBW18yv%2FScreenshot%202023-11-22%20at%2016.36.33.png?alt=media&#x26;token=3f93c339-4b32-4a8e-97b8-153e70a76c28" alt=""><figcaption></figcaption></figure>

This is the end result after running your TaskBot:

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2FTV6eh6XGGgbCdFLuoJh9%2Fspaces_g9LcR8XM7TGOzOCDGsCS_uploads_wDT0yaLivkCX6mFOtj4c_Screenshot%202023-06-16%20at%2017%20copy.png?alt=media&#x26;token=6c3551b7-39b4-4712-8aad-959f6f7586e5" alt=""><figcaption></figcaption></figure>

#### Split from the End of Text

You can enter **negative numbers** in position fields to split from the end of text.

#### **Behavior During Run**

* If the split value **does not contain a requested position**, nothing is saved for that position, and no action is taken.
* **Positive positions** (e.g., `1`, `2`, `3`) start counting from the beginning.&#x20;

  **Examples**:

  * "Hello world", position 1 ⟶ "Hello"
  * "Hello world", position 2 ⟶ "world"
  * "Hello world", position 3 ⟶ *(nothing gets saved)*
* **Negative positions** (e.g., `-1`, `-2`, `-3`) allow counting from the end. *(Supported from the agent version 1.1.61.)*

  **Examples**:

  * "Hello world", position -1 ⟶ "world"
  * "Hello world", position -2 ⟶ "Hello"
  * "Hello world", position -3 ⟶ *(nothing gets saved)*
* **Position 0 is not valid** and does not correspond to any value. TaskBot will generate an error if 0 is used.

### Video Tutorial

{% embed url="<https://youtu.be/iQkygDVEm9Y?si=aZVE5SceNYu0YTJy>" %}
