|| ❪֎ₐ’❫ Dataview Block Words ○ | FLATTEN ⚬ᵈᵛ֎ₐ’
🟣 𓂃𓂃𓂃
⮞ ➔ 𓂃𓂃𓂃
⮞ ⛛ 𓂃𓂃𓂃

⤷ ・・・ ・・・ ・・・



Entries

၊၊||၊|။

FLATTEN ⚬ᵈᵛ|Documentation|1st|20251021003212-00-⌔

Data Commands - Dataview#flatten

FLATTEN

Flatten an array in every row, yielding one result row per entry in the array.

FLATTEN field
FLATTEN (computed_field) AS name

For example, flatten the authors field in each literature note to give one row per author:

TABLE authors FROM #LiteratureNote
FLATTEN authors

📊 ➺

A good use of this would be when there is a deeply nested list that you want to use more easily. For example, file.lists or file.tasks. Note the simpler query though the end results are slightly different (grouped vs non-grouped). You can use a GROUP BY file.link to achieve identical results but would need to use rows.T.text as described earlier.

table T.text as "Task Text"
from "Scratchpad"
flatten file.tasks as T
where T.text
table filter(file.tasks.text, (t) => t) as "Task Text"
from "Scratchpad"
where file.tasks.text

FLATTEN makes it easier to operate on nested lists since you can then use simpler where conditions on them as opposed to using functions like map() or filter().

Printed 2026-06-28.

(echo:: @ )

Link to original

⤷ ・・・・・・・・・


Fields

admin::|[[|⚐]],[[|⚐]],[[|⚐]],[[|⚐]],[[|⚐]],
withheld::|————
relation::|————
parent_::|————
parent::|| ❪֎ₐ’❫ Dataview Block Words ○ | FLATTEN ⚬ᵈᵛ֎ₐ’