Each recipe names the properties it expects. Add those properties to your library or replace the names with yours. The examples on this page use an isolated sample note; running them does not change your shelf.
Progress toward a target
Inputs: Words and Target, both Number properties. The result is a percentage number rounded to one decimal place.
Change the example note’s properties
Run the expression to see its result here.
Date examples use 9 October 2026, 12:00 UTC. Examples run in your browser using Shelf’s formula engine.
A missing or zero target leaves the result empty. This avoids representing an undefined target as completed or unstarted work.
A label from a condition
Input: Done, a Checkbox property. The result is text. Text literals use quotes; property names do not.
Change the example note’s properties
Run the expression to see its result here.
Date examples use 9 October 2026, 12:00 UTC. Examples run in your browser using Shelf’s formula engine.
Toggle Done in the example properties and run it again. If you need a checkbox result for filtering, use the condition itself rather than converting it to text.
Days until a deadline
Input: Due, a Date property. The result is the rounded number of days between today and Due. The example clock is fixed so the result is reproducible.
Change the example note’s properties
Run the expression to see its result here.
Date examples use 9 October 2026, 12:00 UTC. Examples run in your browser using Shelf’s formula engine.
A negative value means the deadline is in the past. An empty Due leaves the result empty. The actual app uses its current clock and date environment, rather than the help example’s fixed clock.
Clean a text value
Input: Title, text. trim removes spaces at the ends; upper changes letter case. It does not rename the note—it returns a calculated text value.
Change the example note’s properties
Run the expression to see its result here.
Date examples use 9 October 2026, 12:00 UTC. Examples run in your browser using Shelf’s formula engine.
Convert text to a number deliberately
Use toNumber when the source really is text and should become a number. A complete decimal string is accepted; units or currency symbols are not silently stripped.
Change the example note’s properties
Run the expression to see its result here.
Date examples use 9 October 2026, 12:00 UTC. Examples run in your browser using Shelf’s formula engine.
Try replacing "1200" with "1200 words". The conversion becomes empty. If an empty conversion should count as zero, make that decision explicit with coalesce(toNumber(YourTextField), 0).
Total related passages
This recipe belongs in a library with a Relationship property named Passages. Each related note needs a Number property named Words.
Passages.Words.sum()
Passages is a list of related notes. .Words reads that field from each note. .sum() totals the resulting numbers.
To total only finished passages, where the target library has a Checkbox property named Done:
Passages.filter(p => p.Done).Words.sum()
Here p means one passage at a time. These relationship recipes require the named libraries and fields, so the small playground’s sample note does not supply them.
Count work still to do
With a Relationship property named Tasks and a Checkbox named Done on the related library:
Tasks.filter(t => !t.Done).length()
The ! means “not.” Filter keeps unfinished tasks, and length counts them. For a checkbox that means “there is at least one task, and all are finished,” use:
Tasks.length() > 0 && Tasks.every(t => t.Done)
The explicit length check matters: every is true for an empty list because there is no item that fails the condition.