Skip to main content
FLO.W 思流Notion Formulas
Writing and Troubleshooting

Formula Writing Rules

Rules for branch return types, plain-language breakdowns, variable naming, empty-value checks, and layered formula design.

Use this page when organizing complex formulas. Read it before writing long formulas so debugging and maintenance do not become painful later.

Keep branch return types as consistent as possible

Not recommended:

Recommended:

if(prop("Done"), "Completed", "Incomplete")

Or:

if(prop("Done"), true, false)

Return types need to be especially strict in automations, button variables, and date-field filling.

Write complex formulas in plain language first

For example, write "project health" as:

  1. Get all tasks.
  2. Count completed tasks.
  3. Count overdue unfinished tasks.
  4. Calculate completion rate and overdue rate.
  5. Output a color label based on the score.

Then translate it into:

lets(  Tasks, prop("Tasks"),  totalCount, Tasks.length(),  completedCount, Tasks.filter(current.prop("Status") == "Completed").length(),  overdueCount, Tasks.filter(current.prop("Status") != "Completed" and not(empty(current.prop("Due Date"))) and current.prop("Due Date") < today()).length(),  ...)

Name variables by business meaning

Not recommended:

lets(a, prop("Tasks"), b, a.length(), c, a.filter(current.prop("Status") == "Completed").length(), c / b)

Recommended:

lets(  taskList, prop("Tasks"),  totalCount, taskList.length(),  completedCount, taskList.filter(current.prop("Status") == "Completed").length(),  if(totalCount == 0, 0, completedCount / totalCount))

Check empty values before calculating

For dates, relations, people, and number inputs, first consider whether the value may be empty.

if(empty(prop("Date")), "", formatDate(prop("Date"), "YYYY-MM-DD"))
if(empty(prop("Project")), "No project", prop("Project").first().prop("Status"))

Design large formulas in layers

For template systems, it is better to separate formulas into three types:

TypePurposeDisplayed?
Raw inputData manually filled in by the userDisplayed
Intermediate metricsHelper calculations, such as completed count, overdue count, or remaining daysCan be hidden
Display resultStatuses, labels, or progress bars shown to the userDisplayed

If all logic is packed into one formula, it may look tidy in the short term, but it becomes much harder to maintain over time.


To use these formulas directly in task reminders, project progress, note heatmaps, and reports, continue with FLO.W Notion Template.

Last updated on