Skip to main content
Notion 公式

公式编辑器与写法

Notion 公式编辑器、点链式写法、current、index、let 和 lets 速查。

Notion 公式编辑器支持多行输入、缩进和注释。复杂公式建议使用多行写法。

lets(
  原价, prop("原价"),
  折扣率, prop("折扣率"),
  折后价, 原价 * (1 - 折扣率),
  round(折后价, 2)
)

注释写法:

/* 这里计算折后价格 */
prop("原价") * 0.8

Notion 公式常见两种写法:

length(prop("标题"))
prop("标题").length()

很多函数都可以点链式书写,列表函数尤其常见:

prop("任务").filter(current.prop("状态") == "已完成").length()

若某个点链式写法在你的工作区无法通过,优先改成公式编辑器提示的写法。

map()filter()some()every()find()findIndex() 这类遍历函数中:

  • current 表示当前遍历到的列表元素。
  • index 表示当前元素的位置,从 0 开始。
prop("任务").filter(current.prop("状态") == "已完成")
prop("标签").map(format(index + 1) + ". " + current)

let() 定义一个变量:

let(
  折扣价,
  prop("原价") * 0.8,
  round(折扣价, 2)
)

lets() 定义多个变量:

lets(
  原价, prop("原价"),
  折扣率, prop("折扣率"),
  折后价, 原价 * (1 - 折扣率),
  round(折后价, 2)
)

变量适合用来减少重复、提高可读性。复杂公式优先用 lets()


想把这些公式直接用在任务提醒、项目进度、笔记热力图和统计报表里,可以继续了解 FLO.W 思流 Notion 模板

最后更新于