Get and format open tasks from Todoist

The Get open items from Todoist-flow uses a liquid template to format your open Todoist tasks based on a Todoist filter.

Parameters

filter

The filter can be any valid Todoist filter expression. For more information, see

The filter input will be interpreted as liquid template.

Examples

due today or overdue
(today | overdue)
use a filename as due date
due: {% assign split = fileBaseName | split: '-' %}{{ split[1] }}/{{ split[2] }}/{{ split[0] }}

ℹ️ The fileMetaData parameter needs to be set and assumes a file base name like 2022-22-07.

use a frontmatter property as filter

Let’s say you have a document for a 1:1 meeting, that looks like this:

---
Filter: "#Peter"
---

Open action items:

Then the following filter configuration will use the frontmatter parameter as filter.

{{ metadata.frontmatter.Filter }}

ℹ️ The fileMetaData parameter needs to be set

template

This liquid template will be used to format the tasks.

Examples

Markdown
{%- for task in tasks %}{% capture line %}

{% for num in (1..task.level)%}    {% endfor %}

- [ ] {{ task.title }}

{% for label in task.labelNames %} #{{ label }}{% endfor %}

{% if task.dueDate %} #due::{{task.dueDate}}{% endif %}
 [todoist]({{ task.url }})

{% endcapture %}{{ line | strip_newlines}}
{% endfor %}
Markdown table
{%- for task in tasks %}
{% capture line %}
|
{{ task.resolutionState }}
|
{{ task.title }}
|
{{ task.creationDate | date: "%Y-%m-%d" }}
|
{{ task.dueDate }}
|
{% for label in task.labelNames %} #{{ label }}{% endfor %}
|
{{task.projectName}}
|
{{ task.url }}
|
{% endcapture %}{{ line | strip_newlines}}{% endfor %}
Markdown grouped by project
# Todoist Tasks
{%- assign projects = tasks | map: "projectName" | uniq %}

## Inbox
{% assign filteredTasks = tasks | where: "projectName", "Inbox" -%}
{%- for task in filteredTasks -%}
{%- capture line -%}

{% for num in (1..task.level)%}    {% endfor %}

- [ ] {{ task.title }}

{% for label in task.labelNames %} #{{ label }}{% endfor %}

{% if task.dueDate %} #due::{{task.dueDate}}{% endif %} [🔗]({{ task.url }})
 
{%- endcapture -%}
{{ line | strip_newlines}}
{% endfor %}

{%- for project in projects %}{% unless project == "Inbox" %}
## {{ project }}
{% assign filteredTasks = tasks | where: "projectName", project -%}
{%- for task in filteredTasks -%}
{%- capture line -%}

{% for num in (1..task.level)%}    {% endfor %}

- [ ] {{ task.title }}

{% for label in task.labelNames %} #{{ label }}{% endfor %}

{% if task.dueDate %} #due::{{task.dueDate}}{% endif %} #project::{{ project }} [🔗]({{ task.url }})
 
{%- endcapture -%}
{{ line | strip_newlines}}
{% endfor %}{% endunless %}{% endfor %}
Taskpaper
{%- assign projects = tasks | map: "projectName" | uniq -%}
{%- for project in projects -%}
{{ project }}:
{% assign filteredTasks = tasks | where: "projectName", project %}

{%- for task in filteredTasks %}{% capture line %}

{% for num in (1..task.level)%} {% endfor %}

- {{ task.title }}

{% for label in task.labelNames %} @{{ label }}{% endfor %}
 @priority({{ task.priority }})
{% if task.dueDate %} @due({{task.dueDate}}){% endif %}
 @todoist({{ task.url }})


{% endcapture %}{{ line | strip_newlines}}
{% endfor %}
{% endfor %}
TODO.txt
{%- assign priorities = "0,A,B,C,D" | split: "," -%}

{%- for task in tasks %}{% capture line %}

({{ priorities[task.priority] }}) {{ task.creationDate | date: "%Y-%m-%d" }} {{ task.title }}

{% assign words = task.projectName | split: ' ' %}
{% capture titlecase %}{% for word in words %}{{ word | capitalize }}{% endfor %}{% endcapture %}
 +{{titlecase }}


{% for label in task.labelNames %} @{{ label }}{% endfor %}
{% if task.dueDate %} due::{{task.dueDate}}{% endif %}

{% endcapture %}{{ line | strip_newlines}}
{% endfor %}

fileMetaData

This parameter is optional. It can be used, if you want to access the metadata of a file in the filter or template.

Preconfigured commands