Formulas: Text Functions

Formulas: Text Functions

A reference guide to text functions in Layer formulas: CONCAT, TRIM, UPPER, LEFT, SUBSTITUTE, and more with AEC examples.

Mike Lee

Thursday, May 7, 2026

Layer formula fields include text functions for working with strings. These are useful for combining fields into a single label, formatting reference codes, extracting substrings, and cleaning imported data.

Function reference

Function

Description

CONCATENATE(text1, text2, ...)

Joins two or more strings into one

UPPER(text)

Converts a string to all uppercase

LOWER(text)

Converts a string to all lowercase

TRIM(text)

Removes leading and trailing whitespace

LEFT(text, count)

Returns the first count characters of a string

RIGHT(text, count)

Returns the last count characters of a string

MID(text, start_index, length)

Returns length characters starting at start_index. The index is zero-based

LENGTH(text)

Returns the number of characters in a string

SEARCH(text, search_text)

Returns the zero-based position of search_text inside text, or -1 if not found

SUBSTITUTE(text, search_text, replacement_text)

Replaces every occurrence of search_text with replacement_text

REGEXMATCH(text, pattern)

Returns TRUE when the string matches the regular expression

REGEXEXTRACT(text, pattern)

Returns the first substring matching the regular expression, or an empty string

REGEXREPLACE(text, pattern, replacement)

Replaces matches of the regular expression with the replacement string

REPEAT(text, count)

Repeats a string the given number of times

ENCODEURICOMPONENT(text)

URI-encodes a string for use in a URL

ARRAYJOIN(array, delimiter)

Joins an array of strings into one string, separated by the delimiter

Common patterns

Combine first and last name

CONCATENATE({First Name}, " ", {Last Name})

Element label from a number and a name

CONCATENATE({Room Number}, " - ", {Room Name})

Uppercase reference code for display

UPPER({Reference Code})

Extract a category prefix from an asset tag

Asset tags often encode a category in the first three characters. LEFT returns that prefix.

LEFT({Asset Tag}, 3)

Strip leading and trailing whitespace from imported text

TRIM({Description})

Replace a placeholder in a text field

SUBSTITUTE({Notes}, "TBC", "Confirmed")

Combine a number with a unit label

Numbers passed to CONCATENATE are converted to strings automatically.

CONCATENATE({Ceiling Height}, " m")

Check whether a string contains a substring

SEARCH returns -1 when no match is found. Compare against 0 with GTE to convert that into a boolean.

IF(GTE(SEARCH({Notes}, "Revit"), 0), "Contains Revit reference", "")

For case-insensitive matching, normalise the searched string with LOWER first.

IF(GTE(SEARCH(LOWER({Notes}), "revit"), 0), "Yes", "No")

Extract the numeric portion of a string

Use REGEXEXTRACT with a digit pattern.

REGEXEXTRACT({Reference Code}, "\\d+")

Build a URL-safe link

Use ENCODEURICOMPONENT when concatenating user-entered text into a URL.

CONCATENATE("https://example.com/search?q=", ENCODEURICOMPONENT({Search Term}))

Things to know

CONCAT does not exist. The function is named CONCATENATE. Layer formula v2 also has no & infix operator for concatenation.

Indices are zero-based. MID("Layer", 1, 3) returns "aye". SEARCH("hello world", "world") returns 6. The first character of any string is at position 0.

SEARCH is case-sensitive. SEARCH({Notes}, "revit") will not match Revit. Wrap the searched text in LOWER to make the search case-insensitive.

There is no LEN, FIND, REPLACE, or generic TEXT function. Use LENGTH, SEARCH, SUBSTITUTE, and DATETOSTRING for date formatting.

Concatenating a possibly empty field. CONCATENATE accepts an empty string as a valid value, so a separator placed between two fields will still appear when one side is empty. To suppress the separator, branch on the empty case with IF.

IF(EQUALS({Middle Name}, ""),
  CONCATENATE({First Name}, " ", {Last Name}),
  CONCATENATE({First Name}, " ", {Middle Name}, " ", {Last Name}))

Additional resources