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
- https://todoist.com/help/articles/introduction-to-filters
- https://www.dandywithlens.com/ultimate-guide-todoist-filters/](https://www.dandywithlens.com/ultimate-guide-todoist-filters
The filter input will be interpreted as liquid template.
Examples
‣
(today | overdue)
‣
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
.
‣
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
‣
{%- 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 %}
‣
{%- 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 %}
‣
# 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 %}
‣
{%- 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 %}
‣
{%- 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.