Skip to Content
đź›  Buildđź›  Action StepsSplit Text

Split Text

Split Text cuts one piece of text wherever a character you choose appears, then hands back either one piece or the whole list.

DockData · ConvertTakestextReturnsone piece or a list of pieces

Use it when something arrives as one line, like "enterprise, b2b, high-priority", and you need the parts separately. Or when you want one piece out of the middle: the domain from an email address, the surname from a full name.

Quick extractions without an extra step: If you only need a single slice or quick domain/list split, you can do it directly inside field tokens with Data Transformation:

  • Domain from email: {{ 2.email | extract_domain }}
  • Surname: {{ 2.name | after:" " }}
  • Split to list: {{ 2.tags | split:comma_space }}

Use the Split Text step when you need to pass an entire list of pieces to downstream canvas steps (like a Loop).

Keyboard shortcut: t+s

Setting it up

Three fields, all required.

Input

The text you want to cut. Pick it from an earlier step with the data picker.

Separator

The character or word to cut on. A comma, a single space, \n for line breaks.

It also accepts a regular expression, which is a pattern language for matching text. That is worth reaching for when the separator varies: a comma that sometimes has a space after it, say. If you do not write patterns, a plain character covers most cases.

Segment Index

Which piece you want back. This is the field that decides whether you get one piece or all of them:

ChooseYou get
FirstEverything before the first separator
SecondThe second piece
LastEverything after the final separator
Second to LastThe piece before the last one
AllEvery piece, as a list

You can also type a number instead: 3 takes the third piece, -2 counts back from the end.

Pick All when you want to loop over the pieces. The named options each return a single piece of text, which is what you want for “the domain” or “the surname”. For “do something with each tag”, choose All and point a looping step at the result.

What it passes on

The piece you asked for (or, with All, the list of pieces), nested under ret:

{{ 4.ret }}

Run it once and read the step’s Executions tab for the exact shape before you build on it; that is quicker than reasoning it out.

Examples to copy

Every tag from one field

A CRM sends a contact’s tags as "enterprise, b2b, high-priority" and you want to act on each.

FieldValue
Inputthe tags field
Separator, (comma, space)
Segment IndexAll

Cutting on comma-and-space rather than the comma alone keeps a leading space off every piece after the first. " b2b" and "b2b" are different text, and a later Filter matching on b2b would miss the first form.

Then turn on Run for each item on the next step and point it at this one. See Loops & Iteration.

A surname from a full name

A form gives you "Jane Doe" and the greeting needs the surname.

FieldValue
Inputfull_name
Separatora space
Segment IndexLast

Last rather than Second, so a double-barrelled surname or a middle name does not break it.

The domain from an email address

FieldValue
Inputthe address
Separator@
Segment IndexLast

Useful in front of a Conditions step that routes by company.

What’s Next?