Skip to content

Formula functions

Every function, method and file field that BaseStudio formulas support, with examples.

This list comes from BaseStudio’s formula engine, so it shows exactly the functions that BaseStudio supports. BaseStudio uses Obsidian’s formula syntax; this reference defines its supported functions. To learn how to write a formula, see Formulas.

A function that is not on this list shows an error in the cell. For example, upper() is not supported, because the engine does not define that global function. Use the supported text methods instead.

Call a global function by its name: today(), max(a, b).

FunctionDescription
date(text)Reads text such as 2026-03-15 or 2026-03-15T10:30 as a date. Example: date("2026-03-15")
now()The current date and time. Example: now()
today()Today's date, with no time. Example: due < today()
number(value)Makes a number from numeric text, a checkbox (1 or 0) or a date (milliseconds). Example: number("42")
list(value)Makes a list from one value. A list stays as it is. Example: list(tags)
link(path, label?)Makes a link to a note, with an optional label. Example: link("Projects/Launch", "Launch")
duration(text)Reads text such as 2h, 1 week, -3 days or P1DT2H as a duration. Example: today() + duration("1 week")
file(path)The file that a path or a link points to, or null when there is no such file. Example: file(owner).name
image(path)Shows the image at a vault path or a web address in the cell. Example: image(cover)
icon(name)Shows a Lucide icon by its name. Example: icon("star")
html(text)Shows text as HTML in the cell. Example: html("<b>New</b>")
escapeHTML(text)Replaces the characters & < > " ' with HTML entities, so that text shows as written. Example: html(escapeHTML(title))
max(number, …)The largest number. Empty values are ignored. Example: max(a, b, c)
min(number, …)The smallest number. Empty values are ignored. Example: min(a, b, c)

if(test, yes, no) is also available. See Formulas.

Call a method on a value with a dot: title.lower(), tags.contains("urgent"). The Works on column tells you which values have the method.

MethodWorks onDescription
isEmpty()any valueTrue for null, empty text, an empty list or an empty object. Example: notes.isEmpty()
isTruthy()any valueTrue when the value counts as true in a condition. Example: done.isTruthy()
isType(name)any valueTrue when the value has this type: string, number, boolean, list, object, date, duration, link, file or regexp. Example: owner.isType("link")
toString()any valueThe value as text. Example: price.toString()
contains(value)text, listTrue when the text contains the text, or the list contains the item. Example: tags.contains("urgent")
containsAny(value, …)text, listTrue when it contains at least one of the values. Example: tags.containsAny("home", "work")
containsAll(value, …)text, listTrue when it contains every one of the values. Example: tags.containsAll("home", "urgent")
lower()textThe text in lower case. Example: status.lower()
title()textThe text with a capital letter at the start of each word. Example: name.title()
trim()textThe text without spaces at the start and the end.
startsWith(text)textTrue when the text starts with this text. Example: code.startsWith("INV-")
endsWith(text)textTrue when the text ends with this text. Example: file.name.endsWith("draft")
replace(pattern, replacement)textReplaces every match of a text. With a regular expression, the g flag replaces all matches. Example: phone.replace(/\s/g, "")
split(separator, limit?)textDivides the text into a list at each separator, which can be a regular expression. Example: authors.split(", ")
repeat(count)textThe text repeated count times (0 to 10,000). Example: "★".repeat(rating)
reverse()text, listThe characters or the items in the opposite order. Example: steps.reverse()
slice(start, end?)text, listThe part from start up to, but not including, end. A negative number counts from the end. Example: title.slice(0, 20)
abs()numberThe number without its sign. Example: (budget - spent).abs()
floor()numberThe number rounded down to a whole number.
ceil()numberThe number rounded up to a whole number.
round(digits?)numberThe number rounded to this many decimal places (0 to 15, default 0). Example: (price * 1.2).round(2)
toFixed(digits)numberThe number as text with exactly this many decimal places (0 to 100). Example: price.toFixed(2)
join(separator)listThe items as one text, with the separator between them. Example: tags.join(", ")
unique()listThe list without repeated items. Example: tags.unique()
sort()listThe items in ascending order. Example: scores.sort()
flat()listPuts the items of lists inside the list into the list itself, one level deep.
filter(condition)listThe items for which the condition is true. Use value and index in the condition. Example: scores.filter(value > 50)
map(expression)listA list of the expression's result for each item. Use value and index in the expression. Example: prices.map(value * 1.2)
reduce(expression, initial)listCombines the items into one value. acc holds the result so far, value the item. Example: prices.reduce(acc + value, 0)
keys()objectThe names of the object's fields, as a list.
values()objectThe values of the object's fields, as a list.
date()dateThe date without its time. Example: file.mtime.date()
time()dateThe time as text, in the form HH:mm:ss. Example: start.time()
relative()dateThe date as text relative to now, such as 3 days ago. Example: file.mtime.relative()
asFile()linkThe file that the link points to, or null. Example: owner.asFile().folder
linksTo(file)linkTrue when the link points to this file. Example: project.linksTo(this.file)
matches(text)regular expressionTrue when the regular expression matches the text. Example: /^\d{4}$/.matches(code)
format(pattern)dateThe date as text in a Moment.js pattern. Tokens: YYYY YY MMMM MMM MM M DD D dddd ddd HH H hh h mm m ss s A a. Text in [brackets] stays as written. Example: due.format("ddd D MMM YYYY")

Text that is one wiki link, such as "[[Launch]]", also has the methods of a link.

  • Text and lists: .length, the number of characters or items.
  • Dates: .year, .month, .day, .hour, .minute, .second, .millisecond.
  • Durations: .years, .months, .weeks, .days, .hours, .minutes, .seconds, .milliseconds.

Call these on file, the record’s file.

MethodDescription
file.hasTag(tag, …)True when the note has one of the tags. A tag also matches its nested tags: project matches project/beta. Example: file.hasTag("project")
file.hasLink(note)True when the note links to this note, link or file. Example: file.hasLink("Team/Priya")
file.hasProperty(name)True when the note's properties include this name, even with an empty value. Example: file.hasProperty("due")
file.inFolder(folder)True when the note is in this folder or in a folder inside it. Write the path from the top of the vault. Example: file.inFolder("Projects/2026")
file.asLink(label?)A link to the note, with an optional label. Example: file.asLink()

Read these on file: file.name, file.mtime.

FieldValue
file.nameThe file name. A Markdown note's name has no .md extension; other files keep their extension.
file.basenameThe file name without its extension.
file.fullnameThe file name. A Markdown note's name has no .md extension; other files keep their extension.
file.extThe extension, such as md.
file.folderThe path of the folder that holds the file.
file.pathThe path of the file from the top of the vault.
file.sizeThe size of the file in bytes.
file.mtimeThe date and time of the last change.
file.ctimeThe date and time the file was made.
file.tagsThe tags of the note: those in its text, then those in its properties.
file.linksThe links in the note.
file.embedsThe embeds in the note.
file.backlinksThe links to the note from other notes.
file.propertiesThe note's properties, as an object.
file.fileThe file itself, for functions that need a file, such as linksTo().
  • A formula can be up to 16 KB long, with up to 2,048 parts and 64 levels of brackets.
  • A regular expression can be up to 500 characters long.
  • A formula can use up to 10,000 calculation steps for each record.