codeRule 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.

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

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

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

Last updated

Was this helpful?