# Rule action: Split text to list

Used for: creating a list from a field that contains multiple values (separated by a certain character).

Used in: "THEN"-statements and "ELSE"-statements.

You need a list in a field if you want to use rules that operate on lists (for example: slice list, split products, sort list). The "Split text to list" rule can create this list for you.

To create a list in a field, that field must contain multiple values separated by a specific character. Examples of such field values:

* XXS, XS, S, M, L, XL, XXL
* 32; 33; 34; 35; 36
* 8719322525833|8719322525468|8719322521125|8719322527776|871932252390

Using the "Split text to list" rule you choose which character to split on (e.g., comma, semicolon, or pipe). The rule creates a list element for every separated value. For example, the screenshots below show splitting a field containing sizes (separated by comma) into a list.

<figure><img src="https://content.gitbook.com/content/u8whzIfip72Kvn3M1bsc/blobs/vU1KOYdH0OLSeDmCmSm6/split_text_to_list.PNG" alt=""><figcaption></figcaption></figure>

This is what the "size" field looked like before this rule:

<figure><img src="https://content.gitbook.com/content/u8whzIfip72Kvn3M1bsc/blobs/QUomu9oksxIeLX5EFfAd/size_after.PNG" alt=""><figcaption></figcaption></figure>

And this is what that same field looks like after applying the rule:

<figure><img src="https://content.gitbook.com/content/u8whzIfip72Kvn3M1bsc/blobs/NZ0qwJoTN0KBGc8FQLgf/size_before.PNG" alt=""><figcaption></figcaption></figure>

After this you could, for example, use the Split products rule to create a product for each size in the list.
