Skip to content

Filters and functions

Anup Chavan edited this page Jun 21, 2026 · 1 revision

Filters and functions

Custom Views has two related tools for transforming data:

  • Pipe filters in output placeholders, such as {{genres|join:", "}}.
  • Expression functions and methods in placeholders and logic, such as {{file.basename.replace(/.*–\s*/, "")}} or {% if artists.length > 1 %}.

The names overlap with Obsidian Web Clipper and Obsidian Bases, but this page documents what Custom Views exposes.

Pipe filters

Dates

Filter Example
date `{{released
date_modify `{{released

Text and case

Filter Example
capitalize `{{title
upper `{{title
lower `{{title
title `{{title
camel `{{title
kebab `{{title
snake `{{title
pascal `{{title
uncamel `{{propertyName
trim `{{title
replace `{{title
safe_name `{{title

Regex replace example:

{{file.basename|replace:"/.*\s*–\s*/":""}}

Markdown and links

Filter Example
wikilink `{{artist
link `{{url
image `{{cover
blockquote `{{quote
markdown `{{summary
strip_md `{{summary
footnote `{{source
fragment_link `{{heading
callout `{{note

Lists and arrays

Filter Example
split `{{genres
join `{{genres
first `{{cover
last `{{artists
slice `{{cast
count `{{tracks
map `{{people
unique `{{tags
list `{{artist
nth `{{artists
merge `{{artists
reverse `{{tracks
length `{{artists

Numbers

Filter Example
calc `{{rating
round `{{score
number_format `{{revenue
duration `{{runtime

HTML and objects

Filter Example
strip_tags `{{html
remove_html `{{html
remove_tags `{{html
strip_attr `{{html
remove_attr `{{html
replace_tags `{{html
unescape `{{html
object `{{json
template `{{value
html_to_json `{{html
default `{{subtitle
table `{{rows

Expression globals

Function Example
link {{link("Artist")}}
file {{file("Music/Song.md")}}
if {{if(rating > 8, "Great", "OK")}}
for Advanced expression loop helper. Prefer template {% for %} for markup.
now {{now()}}
today {{today()}}
date {{date("2026-01-01")}}
duration {{duration("2 hours")}}
min / max {{max(rating, 10)}}
random {{random()}}
list {{list(album)}}
number {{number(track)}}
image {{image(cover[0])}}
icon {{icon("star")}}
html {{html("<strong>OK</strong>")}}
escapeHTML {{escapeHTML(description)}}
length {{length(artists)}}
typeof {{typeof(rating)}}
concat {{concat(firstName, " ", lastName)}}

String methods

contains, containsAll, containsAny, endsWith, startsWith, isEmpty,
lower, upper, title, capitalize, trim, replace, repeat, reverse,
slice, split, length, toString, isTruthy, isType

Examples:

{{file.basename.replace(/.*\s*–\s*/, "")}}
{% if file.basename.startsWith("Ritviz") %}...{% endif %}

Number methods

abs, ceil, floor, round, toFixed, isEmpty, toString, isTruthy, isType

Example:

{{rating.round(1)}}

List methods

contains, containsAll, containsAny, filter, flat, isEmpty, join, map,
reduce, reverse, slice, sort, unique, first, last, length, toString,
isTruthy, isType

Examples:

{% if artists.length > 1 %}...{% endif %}
{{genres.join(" · ")}}
{{artists.first()}}

Date, link, file, and object methods

Type Methods
Date format, date, time, relative, year, month, day, hour, minute, second, millisecond, isEmpty, toString, isTruthy, isType
Link asFile, linksTo, toString, isTruthy, isType
File content, asLink, hasLink, hasProperty, hasTag, inFolder, toString, isTruthy, isType
Object isEmpty, keys, values, toString, isTruthy, isType

Bases functions

Inside {% base %} blocks, write native Obsidian Bases YAML. Filters and formulas there use Obsidian Bases syntax, not Custom Views pipe filters. See Obsidian Bases functions for the official Bases function reference.

Wiki pages

Clone this wiki locally