Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Created September 14, 2023 19:48
Show Gist options
  • Save typeoneerror/0e7bcd66aa62aaff1eb5e3fd820cda14 to your computer and use it in GitHub Desktop.
Save typeoneerror/0e7bcd66aa62aaff1eb5e3fd820cda14 to your computer and use it in GitHub Desktop.
Display next incomplete task in Notion
lets(
/* Store unfinished actions */
actions, prop("Actions").filter(current.prop("Status") != "Done"),
/* Sort by timestamp of task and store with id */
actionId,
actions
.map(formatDate(current.prop("Date"), "X") + "-" + current.id())
.sort()
.first()
.split("-")
.last(),
/* Explode stored id and find the task with that id */
nextAction,
actions.find(current.id() == actionId),
nextAction + " " + nextAction.prop("Date")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment