Learn what formulas are available when using in-line formulas in your Zaps.
Text
Text.concat
Text.concat(text,text)
Combines two strings.
Required input
"a","b" The input strings you want to combine.
- Wrap each string separately in double quotation marks.
- Separate strings with commas.
Output
result The single string of all combined input values.
Input: Text.concat("Hello ","world!")
Output: Hello world!
Text.lowercase
Text.lowercase("text")
Converts all uppercase alphabetic characters in a string to lowercase.
Required input
text The input string you want to convert to lowercase.
Output
result The converted lowercase string.
Input: Text.lowercase("Hello")
Output: hello
Text.trim
Text.trim("text")
Removes any leading and trailing spaces from a string.
Required input
text The string you want to remove leading and trailing spaces from.
Output
result The converted string with leading and trailing spaces removed.
Input: Text.trim(" hello")
Output: hello
Input: Text.trim("hello ")
Output: hello
Input: Text.trim(" hello world ")
Output: hello world
Text.uppercase
Text.uppercase("text")
Converts all lowercase alphabetic characters in a string to uppercase.
Required input
text The input string you want to convert to uppercase.
Output
result The converted uppercase string.
Input: Text.uppercase("Hello")
Output: HELLO
Text.extract_email
Text.extract_email("text")
Extracts the first email address found in a string.
Required input
text The string containing an email address.
Output
result The string containing only an email address.
Input: Text.extract_email("Contact support@zapier.com")
Output: support@zapier.com
Text.extract_number
Text.extract_number("number")
Extracts the first number found in a string.
Required input
number The string containing a number.
Output
result The string containing only a number.
Input: Text.extract_number("Total: $1,234.50")
Output: 1234.5
Text.extract_url
Text.extract_url("text")
Extracts the first URL found in a string.
Required input
text The text containing a URL.
Output
result The string containing only a URL.
Input: Text.extract_url("Visit https://zapier.com")
Output: https://zapier.com
Utility
Utils.default
Utils.default("value","default_value")
Returns the value you enter, or a default value if the input is null, undefined, or empty.
Required input
value The string or list to evaluate for null, undefined, or empty values.
default_value The string or list to return if value is null, undefined, or empty.
Output
result The original input value, if present; otherwise, the default value.
Input: Utils.default("apple","Fruit")
Output: apple
Input: Utils.default("","Fruit")
Output: Fruit
Utils.strip_tags
Utils.strip_tags("value")
Removes all HTML or XML tags from a string. Returns plain text.
Required input
value The input HTML or XML string to remove tags from.
Output
result The converted plain text value.
Limitation
The Zap will only remove complete HTML tags. If you have an incomplete HTML tag, like <p or </div, the Zap will not remove it.
Input: Utils.strip_tags("<div>Hi <strong>there</strong></div>")
Output: Hi there
List
List.markdown_ordered_list
List.markdown_ordered_list("value")
Format a list of items as a numbered Markdown-formatted list.
Required input
items The string list of text items to format into a numbered list.
start (Optional) The number to start the list from.
separator (Optional) The symbol used to separate the number from each item. The default is a period ..
Output
result The full Markdown-formatted numbered list as a string.
Input: List.markdown_ordered_list(Object.parse_json('["a","b","c"]'))
Output:
1. a 2. b 3. c
List.markdown_unordered_list
List.markdown_unordered_list("value")
Format a list of items as a bulleted Markdown-formatted list.
Required input
items The string list of text items to format into a bulleted list.
prefix (Optional) The bullet character to use for each item. The default is a hyphen -.
Output
result The full Markdown-formatted bulleted list as a string.
Input: List.markdown_unordered_list(Object.parse_json('["a","b","c"]'))
Output:
- a - b - c
Object
When using JSON, you must wrap the entire string, object, or array in straight single quotation marks (''), not angled double quotation marks (“”). Learn more about tips and tricks for using in-line formulas.
Object.keys
Object.keys("obj")
Returns a list of the top-level keys in an object.
Required input
obj The object to get keys from.
Output
result A list of the top-level keys.
Input: Object.keys(Object.parse_json('{"user":{"name":"Zapier","account":"Pro"}}'))
Output: user
Object.parse_json
Object.parse_json("json_str")
Parses a JSON-formatted string and returns an object or list.
Required input
json_str A valid JSON-formatted string to parse into an object.
- Handles both object
{}and array[]JSON strings.
Output
result A parsed object or array, returned as an object or list.
Input: Object.parse_json('{"user":{"name":"Zapier","account":"Pro"}}')
Output: user: {'account': 'Pro', 'name': 'Zapier'}
Object.to_json
Object.to_json("json_str")
Converts an object or list into a JSON-formatted string.
Required input
obj An object or list to convert into a JSON-formatted string.
Output
result A valid JSON string representing the original object or list.
Input: Object.to_json(Object.parse_json('{"user":{"name":"Zapier","account":"Pro"}}'))
Output: {"user": {"name": "Zapier", "account": "Pro"}}
Object.values
Object.values("obj")
Returns a list of top-level values from an object.
Required input
obj The object to get values from.
Output
result A list of the top-level values.
Input: Object.values(Object.parse_json('{"user":{"name":"Zapier","account":"Pro"}}'))
Output: {"name": "Zapier", "account": "Pro"}
Additional resources
Learn about tips and tricks for using in-line formulas.