Text
Built-in step · 24 steps
Edit, split, join, search, and check text.
Steps
| Step | What it does |
|---|---|
| Check end of text | Check whether text ends with specific words or characters. |
| Check if text includes | Check whether text includes specific words or characters. |
| Check start of text | Check whether text starts with specific words or characters. |
| Convert HTML to Markdown | Turn HTML, like an email's body or a web page, into Markdown that reads as plain text and keeps its headings, lists, links, bold and italic, tables and code: ready for an AI step, a Slack message or a note. |
| Convert JSON to XML | Turn data or JSON text into an XML document, for an API or a service that speaks XML, a feed or a file: each field becomes an element named after it, a list repeats its element, and a field named like @id becomes an attribute. |
| Convert Markdown to HTML | Turn Markdown, like an AI step's answer or a template you write, into plain HTML for a web page, a rich-text field or an app that takes HTML: headings, lists, links, bold and italic, tables and code all come through. |
| Convert XML to JSON | Turn XML, like an API's response or a feed, into data whose fields later steps can use, the way Read a file reads an XML file: each element is a field named by its tag, a tag that repeats is a list, and attributes are fields too. |
| Count characters | Count how many characters are in text. |
| Count words | Count how many words are in text. |
| Encode or decode text | Make text safe to put in a web address, HTML or JSON, encode or decode Base64, or remove accents and emoji. |
| Extract from text | Pull matches out of text: an email address, web address, phone number, domain, number, or your own pattern. |
| Format phone number | Write a phone number one standard way, however it was typed, like +1 415-555-0123 or +14155550123 for a texting app. |
| Format text | Change the letter case of text: make it uppercase, lowercase, capitalize the first letter, use title or sentence case, or turn it into a slug for a web address. |
| Get part of text | Take a piece of text: what comes before or after a word or character, what sits between two, or a number of characters from a position. |
| Join list into text | Turn a list into one piece of text. |
| Look up a value in a table | Turn one value into another with a small table you fill in, like US to United States or a status code to a label, instead of a chain of If steps. |
| Match keywords | Score text against your keyword lists to see how well it matches. |
| Read JSON text | Turn JSON written as text, like an AI step's answer or a webhook body, into data whose fields later steps can use. |
| Replace text | Find text and replace it with something else. |
| Shorten text | Shorten text so it fits within a set number of characters. |
| Split text | Split text into a list. |
| Trim whitespace | Remove spaces, tabs, and line breaks from the start and end of text. |
| Use a fallback if empty | Use a value, or a fallback when it is empty, like a first name or "there" when a contact has none. |
| Validate text | Check whether text is a valid email address, web address, or phone number. |
Check end of text
Check whether text ends with specific words or characters.
Inputs
- Text
texttextRequired - The text to check.
- Ends with
suffixtextRequired - The text it should end with, such as .pdf.
- Case sensitivity
case_sensitivetrue/false - Match upper- and lower-case letters exactly (the default). Turn this off to treat them as the same.Default:
true.
Outputs
Whether the text ends with the text given.
Example output
trueCheck if text includes
Check whether text includes specific words or characters.
Inputs
- Text to search through
texttextRequired - The text to search through.
- Text to find
substringtextRequired - The exact text to look for.
- Case sensitivity
case_sensitivetrue/false - Match upper- and lower-case letters exactly (the default). Turn this off to treat them as the same.Default:
true.
Outputs
Whether the text includes the text searched for.
Example output
trueCheck start of text
Check whether text starts with specific words or characters.
Inputs
- Text
texttextRequired - The text to check.
- Starts with
prefixtextRequired - The text it should start with.
- Case sensitivity
case_sensitivetrue/false - Match upper- and lower-case letters exactly (the default). Turn this off to treat them as the same.Default:
true.
Outputs
Whether the text starts with the text given.
Example output
trueConvert HTML to Markdown
Turn HTML, like an email's body or a web page, into Markdown that reads as plain text and keeps its headings, lists, links, bold and italic, tables and code: ready for an AI step, a Slack message or a note. Scripts and styles are left out.
Inputs
- HTML
texttextRequired - The HTML to convert, a whole page or a piece of one.
Outputs
The Markdown.
Example output
"# Hello\n\nSome **bold** text."Convert JSON to XML
Turn data or JSON text into an XML document, for an API or a service that speaks XML, a feed or a file: each field becomes an element named after it, a list repeats its element, and a field named like @id becomes an attribute.
Inputs
- Data
datatextRequired - The data to write as XML: a record or a list from an earlier step, or JSON text.
- Root element
roottext - The name of the element that wraps everything, like order or request. Defaults to root.Default:
root.
Outputs
The XML document, indented, with an XML declaration on its first line.
Example output
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<order id=\"1042\">\n <customer>Jordan Lee</customer>\n <total>84.00</total>\n</order>"Convert Markdown to HTML
Turn Markdown, like an AI step's answer or a template you write, into plain HTML for a web page, a rich-text field or an app that takes HTML: headings, lists, links, bold and italic, tables and code all come through. For an email, use HTML's Turn text into HTML, which adds the styles email apps show.
Inputs
- Markdown
texttextRequired - The Markdown to convert. A line break in it is a line break in the HTML, and HTML tags in it pass through.
Outputs
The HTML, without <html> or <body> around it and with no styles, ready to put in a page or a field.
Example output
"<h1>Hello</h1>\n<p>Some <strong>bold</strong> text.</p>"Convert XML to JSON
Turn XML, like an API's response or a feed, into data whose fields later steps can use, the way Read a file reads an XML file: each element is a field named by its tag, a tag that repeats is a list, and attributes are fields too.
Inputs
- XML
texttextRequired - The XML to convert.
Outputs
What the outermost element holds: a record of its elements and attributes, or its text when it holds only text. Text stays text, so a number in the XML is text like "3".
Example output
{
"order": [
{
"customer": "Jordan Lee",
"id": "1042",
"total": "84.00"
},
{
"customer": "Sam Rivera",
"id": "1043",
"total": "12.50"
}
]
}Count characters
Count how many characters are in text.
Inputs
- Text
texttextRequired - The text to measure.
Outputs
The number of characters in the text.
Example output
13Count words
Count how many words are in text.
Inputs
- Text
texttextRequired - The text whose words are counted.
Outputs
The number of words in the text.
Example output
9Encode or decode text
Make text safe to put in a web address, HTML or JSON, encode or decode Base64, or remove accents and emoji.
Inputs
- Text
texttextRequired - The text to encode or decode.
- Change it to
encodingtextRequired - How to change the text.One of:
url_encode(Safe for a web address (a b → a%20b)),url_decode(Back from a web address (a%20b → a b)),base64_encode(Base64),base64_decode(Back from Base64),html_escape(Safe for HTML (< → <)),html_unescape(Back from HTML (< → <)),json_escape(Safe inside JSON text),plain_ascii(Plain letters, no accents or emoji). Default:url_encode.
Outputs
The text, encoded or decoded.
Example output
"Hello%20world"Extract from text
Pull matches out of text: an email address, web address, phone number, domain, number, or your own pattern.
Inputs
- Text
texttextRequired - The text to search, such as the body of an email.
- Extract
typetextRequired - What to pull out of the text.One of:
email(Email address),url(Web address),phone(Phone number (+14155550123)),domain(Domain (example.com)),path(Web address path (/blog/post)),number,pattern(Custom pattern). Default:email. - Custom pattern
patterntext - A regular expression to search for. Used only when Extract is set to Custom pattern.Only when Extract is Custom pattern.
- Return
all_matchestrue/false - Return only the first match, or every match as a list.Default:
false. - Country
regiontext - The country of phone numbers written without a country code. Defaults to the United States.Only when Extract is Phone number (+14155550123). Default:
US.
Outputs
The first match, or a list of every match when all matches are asked for. Numbers come back as numbers, and finding nothing gives empty text, or an empty list.
Example output
1234.5Format phone number
Write a phone number one standard way, however it was typed, like +1 415-555-0123 or +14155550123 for a texting app.
Inputs
- Phone number
texttextRequired - The phone number, written any way.
- Write it as
styletextRequired - How to write the number.One of:
international(International (+1 415-555-0123)),e164(For apps (+14155550123)),national(National ((415) 555-0123)). Default:international. - Country
regiontext - The country of numbers written without a country code. A number that starts with its own, like +44, is read in that country instead. Defaults to the United States.Default:
US.
Outputs
The phone number, written the chosen way.
Example output
"+1 415-555-0123"Format text
Change the letter case of text: make it uppercase, lowercase, capitalize the first letter, use title or sentence case, or turn it into a slug for a web address.
Inputs
- Text
texttextRequired - The text to change the letter case of.
- Format as
casetextRequired - How the text should be cased.One of:
uppercase(Uppercase (HELLO WORLD)),lowercase(Lowercase (hello world)),capitalize(Capitalize first letter (Hello world)),title(Title case (Hello World)),sentence(Sentence case (Hello world. Bye now.)),slug(Web address slug (hello-world)). Default:uppercase.
Outputs
The text in the chosen letter case.
Example output
"Hello World"Get part of text
Take a piece of text: what comes before or after a word or character, what sits between two, or a number of characters from a position. For example, the name before the @ in an email address.
Inputs
- Text
texttextRequired - The text to take a part of.
- Take
parttextRequired - Which part of the text to take.One of:
before(The text before),after(The text after),between(The text between),characters(Characters by position). Default:after. - Look for
markertext - The word or characters to look for, like @ or Order #. Letter case doesn't matter, and the first one found is used.Only when Take is The text before, The text after or The text between.
- Up to
end_markertext - Where the part ends: the next time this appears after the text looked for.Only when Take is The text between.
- From position
startnumber - The first character to take: 1 is the first character, -1 the last, -4 the fourth from the end.Only when Take is Characters by position. Default:
1. - Number of characters
countnumber - How many characters to take. Leave empty for the rest.Only when Take is Characters by position.
Outputs
The part of the text, without spaces around it. Blank text when what was looked for isn't there.
Example output
"ana"Join list into text
Turn a list into one piece of text.
Inputs
- List
itemslistRequired - The list of values to combine into one piece of text.
- Put between items
separatortextRequired - Use empty text to join with nothing.
Outputs
The list's items as one piece of text, with the separator between each.
Example output
"red, green, blue"Look up a value in a table
Turn one value into another with a small table you fill in, like US to United States or a status code to a label, instead of a chain of If steps.
Inputs
- Value to look up
valuetextRequired - The value to find in the table, like a country code.
- Table
tableobjectRequired - Each value to look for, and what to give back for it. Letter case and spaces around a value don't matter.
- If nothing matches
fallbacktext - What to give back when the value isn't in the table. Leave empty to get a blank.
- Case sensitivity
case_sensitivetrue/false - Match upper- and lower-case letters exactly. Off by default, so us, US and Us all match.Default:
false.
Outputs
What the table gives for the value, the fallback when it isn't there, or a blank without one.
Example output
"United States"Match keywords
Score text against your keyword lists to see how well it matches. Useful for tagging, filtering, or deciding what should happen next.
Inputs
- Text
texttextRequired - The text to score. Letter case is ignored.
- Strong keywords
strong_termslistRequired - Most important words or phrases. Each match adds 3 points.
- Medium keywords
medium_termslist - Fairly important words or phrases. Each match adds 2 points.
- Weak keywords
weak_termslist - Minor words or phrases. Each match adds 1 point.
- Score needed to pass
thresholdnumber - Total points needed to count as a match. Defaults to 3.Default:
3.
Outputs
Whether the text matched, its score, and which keywords it contains.
is_matchtrue/false- Whether the score reached the score needed.
matched_termslist- The keywords found, strong ones first, each with the list it came from.
scorenumber- 3 points for each strong keyword found, 2 for each medium one, and 1 for each weak one.
Example output
{
"is_match": true,
"matched_terms": [
{
"term": "we're hiring",
"tier": "strong"
},
{
"term": "join our team",
"tier": "medium"
},
{
"term": "engineer",
"tier": "weak"
}
],
"score": 6
}Read JSON text
Turn JSON written as text, like an AI step's answer or a webhook body, into data whose fields later steps can use.
Inputs
- JSON text
texttextRequired - The text holding the JSON. It may be wrapped in a code block or a sentence.
Outputs
The data the JSON holds, usually a record or a list.
Example output
{
"name": "Ana",
"plan": "pro"
}Replace text
Find text and replace it with something else.
Inputs
- Text to search through
texttextRequired - The text to search through.
- Text to find
searchtextRequired - The text to find, or a pattern. Every occurrence is replaced.
- Replace with
replacetextRequired - The text to put in its place.
- Case sensitivity
case_sensitivetrue/false - Match upper- and lower-case letters exactly (the default). Turn this off to treat them as the same.Default:
true. - Find
search_typetext - The exact text, or a pattern (a regular expression). With a pattern, $1 in the replacement puts back what its first group in brackets matched, $2 the second.One of:
text(The exact text),pattern(A pattern (regular expression)). Default:text.
Outputs
The text with every occurrence of the text searched for replaced.
Example output
"Order #123 is shipped"Shorten text
Shorten text so it fits within a set number of characters. By default no ending is added; set an ending like “…” to append one when text is cut. The ending counts toward the limit, so the result never exceeds it.
Inputs
- Text
texttextRequired - The text to shorten.
- Maximum characters
lengthnumberRequired - Text longer than this is shortened.
- Ending
ellipsistext - Optional ending added when text is shortened, e.g. “…”, counted within the character limit. Leave blank (the default) to shorten without any ending.
- Whole words
dont_split_wordstrue/false - Keep whole words instead of cutting one in the middle. When on, the text is shortened at a word boundary, so the result may come out a little shorter than the limit.Default:
false.
Outputs
The text cut to at most the given number of characters, the ending included, or unchanged if it was short enough.
Example output
"The quick brown fox..."Split text
Split text into a list. Spaces around each piece are left out.
Inputs
- Text
texttextRequired - The text to break into pieces.
- Split at
delimitertextRequired - The text to break at, such as a comma or a space.
Outputs
The pieces of the text between the separators.
Example output
[
"red",
"green",
"blue"
]Trim whitespace
Remove spaces, tabs, and line breaks from the start and end of text.
Inputs
- Text
texttextRequired - The text to trim.
- Trim from
modetext - Which ends to trim: both ends, only the start, or only the end. Defaults to both ends.One of:
both(Both ends),left(Start),right(End). Default:both.
Outputs
The text with spaces, tabs and line breaks removed from its start, its end, or both.
Example output
"Hello world"Use a fallback if empty
Use a value, or a fallback when it is empty, like a first name or "there" when a contact has none. Zero and false count as values.
Inputs
- Value
valuetextRequired - The value to use when it isn't empty.
- Fallback
defaulttextRequired - What to use instead when the value is missing, blank, or an empty list.
Outputs
The value, or the fallback when the value is empty.
Example output
"there"Validate text
Check whether text is a valid email address, web address, or phone number.
Inputs
- Text
texttextRequired - The text to check, such as an email address, web address or phone number.
- Validate as
typetextRequired - What kind of value to check for.One of:
email(Email address),url(Web address),phone(Phone number). Default:email. - Country
regiontext - The country of numbers written without a country code. A number that starts with its own, like +44, is checked against that country instead. Defaults to the United States.Default:
US.
Outputs
Whether the text is a valid email address, web address or phone number, whichever was chosen.
Example output
true