Intermediate · Lesson 09 of 22

Text Formulas

Concatenate, Upper, Contains, Substitute, Trim, Regex — transform stored values into exactly what you need for display, logic, and data cleaning.

⏱ ~22 min 📝 Text manipulation ✅ Prerequisite: Lesson 08
01 — Why Text Formulas? 02 — Concatenate & & 03 — Case Functions 04 — Contains, Find, Substitute, Trim 05 — Substring Extraction 06 — RegexMatch & RegexExtract Practice
01 — Why Text Formulas?

Coda stores values. Formulas transform them.

Your columns store raw data — a first name here, a last name there, an email address, a raw description imported from a spreadsheet. Text formulas let you reshape that data for display, drive conditional logic from it, clean imported noise out of it, and extract structured pieces from unstructured strings.

🔗

Combine

Merge multiple columns into one display value. First + Last → Full Name. Domain + Path → URL.

🧹

Clean

Strip unwanted whitespace, normalize case, replace stale text — critical when importing from other tools.

🔍

Validate & Extract

Check if a string matches a pattern. Pull a substring or domain from an email. Regex gives you full power.

02 — Concatenate & &

Joining text with Concatenate

The most common text operation: combining two or more strings into one. Coda gives you two equivalent ways to do it.

Long form — explicit
Concatenate(thisRow.[First Name], " ", thisRow.[Last Name])
Short form — & operator (same result)
thisRow.[First Name] & " " & thisRow.[Last Name]
Contacts — Full Name formula column
First Name Text Last Name Text Full Name Formula
AliceNakamuraAlice Nakamura
BobOseiBob Osei
CarolFerreiraCarol Ferreira
Formula: thisRow.[First Name] & " " & thisRow.[Last Name]
Concatenate accepts any number of arguments Concatenate(a, b, c, d, …) — you can join as many strings as you like. The & operator chains only two at a time, but you can chain multiple & operators in one expression.
03 — Case Functions

Upper, Lower, Proper

These three functions normalize case — invaluable when you have inconsistent input from multiple team members or imported data.

Upper()

Upper("hello world")
→ "HELLO WORLD"

All characters to uppercase. Useful for headers, codes, acronyms.

Lower()

Lower("Hello World")
→ "hello world"

All characters to lowercase. Useful before comparisons to make them case-insensitive.

Proper()

Proper("hello world")
→ "Hello World"

Capitalizes the first letter of each word. Great for display names from raw imports.

04 — Contains, Find, Substitute, Trim

Search, replace, and clean text.

Contains()

Returns true or false depending on whether a string includes a substring. Most useful inside an If().

Contains("hello world", "world")   → true
Contains("hello world", "xyz")     → false

// Practical: flag rows where notes mention a client
If(Contains(thisRow.[Notes], "Acme"), "⭐ Key account", "")

Find()

Returns the position (index) of a substring within a string. Returns 0 if not found. Often used to split strings or validate format.

Find("@", "alice@example.com")   → 6
Find("@", "notanemail")           → 0 (not found)

Substitute()

Replaces every occurrence of a substring with a new string. Great for cleaning up imported data or updating stale terminology across a column.

Substitute("hello world", "world", "Coda")
→ "hello Coda"

// Remove hyphens from phone numbers
Substitute(thisRow.[Phone], "-", "")

Trim()

Removes leading and trailing whitespace. Critical when importing data — invisible spaces break exact-match filters and look identical visually.

Trim("  hello world  ")   → "hello world"

// Always Trim imported text before comparing
Trim(thisRow.[Imported Name]) = "Alice"
Cleaning rule of thumb Whenever you're importing from a spreadsheet, CSV, or form, run Trim() on any text column you'll use in comparisons. Invisible leading spaces are the #1 cause of "why isn't my filter working?" bugs.
05 — Substring Extraction

Left, Right, Mid, Len

When you need only part of a string — the first N characters, the last N characters, or a slice from the middle — these four functions have you covered.

Substring functions — reference
FunctionSyntaxExampleResult
Left() Left(text, n) Left("Coda Rules", 4) "Coda"
Right() Right(text, n) Right("Coda Rules", 5) "Rules"
Mid() Mid(text, start, length) Mid("Coda Rules", 6, 5) "Rules"
Len() Len(text) Len("Coda Rules") 10

A practical combination: extract the domain from an email address using Find() to locate the @, then Mid() to take everything after it.

Domain column — extracts "example.com" from "alice@example.com"
Mid(
  thisRow.[Email],
  Find("@", thisRow.[Email]) + 1,
  Len(thisRow.[Email])
)
06 — RegexMatch & RegexExtract

Pattern matching with Regex

Regular expressions give you surgical control over text matching. Coda exposes them through two functions. You don't need to master regex to use them — a few patterns cover the vast majority of real-world needs.

RegexMatch()

Returns true or false. Use it inside If() to validate format — emails, phone numbers, URLs, postal codes.

Email validation column
If(
  RegexMatch(
    thisRow.[Email],
    "^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,}$"
  ),
  "✓ Valid",
  "✗ Invalid"
)

RegexExtract()

Returns the first substring that matches the pattern — or empty string if nothing matches. Use it to pull structured data out of messy free-text fields.

Extract a URL from a description field
RegexExtract(
  thisRow.[Description],
  "https?://[^\s]+"
)
→ "https://example.com" (first URL found in the text)
Common regex patterns to bookmark ^[0-9]+$ — digits only  ·  ^[A-Z]{2,3}$ — 2–3 uppercase letters  ·  https?://[^\s]+ — any URL  ·  \d{4}-\d{2}-\d{2} — ISO date format
Contacts — Email validation formula in action
Name Email Text Valid? Formula
Alice alice@example.com ✓ Valid
Bob bob AT example DOT com ✗ Invalid
Carol carol@co.uk ✓ Valid
Dave not-an-email ✗ Invalid
Practice

Fill in the blanks.

Text Formulas

5 Questions
Question 1 of 5
___________(thisRow.[First Name], " ", thisRow.[Last Name]) combines first and last name into one value.
Question 2 of 5
Contains("hello world", "world") returns: _____
Question 3 of 5
__________("hello world", "world", "Coda") returns "hello Coda".
Question 4 of 5
_____("hello") returns "HELLO".
Question 5 of 5
To check whether an email address matches the correct format, use __________(thisRow.[Email], "pattern").
← Prev Introduction to Formulas Lesson 08