# Rule action: Split text

{% hint style="info" %}
Used for: splitting up the content of a field on a certain character or word, and then using one or more of the parts of the split content.

Used in: "THEN"-statements and "ELSE"-statements.
{% endhint %}

The "split text" rule splits up a field every time a character or word of your choice appears in that field. By using the split text rule you basically cut up a field into several parts. You can then select one or more of these parts to fill a field of your choice.

An example: let's say your descriptions contain the size of your products. You can use the split text rule to fill the "size" field with the part that comes after the word "size:" in your description.

<figure><img src="/files/a366fb6fef1d7898c87b8cede5a7aad1cfd4426e" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### Step: First split — extract everything after "size:"

Use the "split text" rule to split the description on the word "size:" and then select the part that follows it to fill the "size" field.

This will set the size field to the entire second part (everything after "size:").

![split text example step 1](/files/77f7451d0d4a043b043cc9b1101fafa626a82102)
{% endstep %}

{% step %}

### Step: Second split — refine to just "XL"

If the second part still contains extra text (for example: "XL, other info"), add another "split text" rule on the newly populated "size" field. Split on the comma and select the part before the comma (first part) to get only "XL".

This additional step refines the size field to the exact value you want.

![split text example step 2](/files/b5df571fefead12e8e25a983d976765765a0e754)
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-actions-then-in-rules/rule-action-split-text.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
