Using Zapier with Drafts

Integrating with Zapier

Zapier is an online automation service that integrates with hundreds of services and APIs. While Drafts has great direct integration with many services, Zapier supports many more. If there are services Drafts does not directly support, Zapier is a great way to incorporate them in your Drafts workflow. This includes Facebook, LinkedIn, Office365 apps, and many more.

Zapier “Zaps” are automation tools set up with a trigger and action. This guide covers how to configure Drafts actions to send data to a trigger in a Zapier Zap…which can then be acted on in Zapier.

Zapier Guide: The team at Zapier has put together their own guide to Drafts which includes more extensive coverage of Drafts integration. It’s a great place to start.

Webhooks

Zaps can be configured with a “Catch Hook” type Webhook trigger, which creates a unique URL to send information to and trigger the Zap. Using webhooks allows Drafts to send multiple values to Zapier which can be inserted into the Zap action.

Once you have configured a Zap with a “Catch Hook” trigger, install one of these example actions:

  • Zapier: Catch Hook Example using Credentials
    • Uses Drafts Credentials to store the catch hook URL. The first time you run it you will be prompted to enter the hook URL which can be pasted from the Zapier site, and it will be remembered for future use. To set up multiple zaps, this action can be duplicated and the “zapIdentifier” in the first script step changes to a unique value for each zap you want to target.
  • Zapier: Catch Hook with Hard Coded URL
    • This is same same as above, but with the hookURL hard-coded as a variable in the script. After installing the action, edit it and change the hookURL value to match the URL of your Zap.

These examples send “title”, “body” and “content” values from the current draft to the Zap as elements that can be inserted into an action.

Email Triggers

Zapier also supports triggering zap via email triggers. When a zap is configured for email, it gets assigned a unique incoming email address. A Drafts mail action step can then be configured to send to that email address and trigger the action. Since a unique address is used, the Drafts mail action step can be configued to “Send in Background”, so no additional action is required when running the action in Drafts.

In general, unless you have a specific reason, we recommend you use Webhook triggers because they directly communicate with Zapier and will be more immediate as a result. Email triggers may be delayed by mail delivery time, etc.

2 Likes

Just curious, but is a similar integration with IFTTT ever likely, considering it supports webhooks (with up to 3 variables) too?

2 Likes

I’m curious whether you could do this…

  • Todoist: When I mark a task as completed…
  • Zapier: Magic…
  • Drafts: Append task name to a note

The point being…
It would be useful to have a list of completed tasks, which Todoist actually does not provide.

I do not think it could be automatic, but Drafts has full support for the Todoist API, and could directly import completed tasks with an action. See example import tasks action. @FlohGro might have some input, he’s done a lot with the Todoist API and Drafts.

1 Like

You can check out Draftist: GitHub - FlohGro-dev/Draftist: Todoist integration for Drafts

But the API does not offer a way to retrieve the completed tasks - at least I didn’t found something right now here: developer.todoist.com

Just that a response object can include "completed": true, so you could filter a /tasks/ response object for that, I suppose.

Yes you’re right! I did not look it up but I don’t know if there’s a completion date parameter in the object.

Indeed. I guess you’d be doing something like pulling dated tasks from a specific date range, or since last pull, and checking completion status.

This is frankly all to solve for the fact that Todoist itself doesn’t offer a viable completed-tasks view at its own fundamental level.

You can see them in the overall activity log, and you can see them in individual projects. But completion status is not surfaceable through filters.

They are overlooking the importance of knowing how much you have accomplished. Knowing what to do, when to do it and how many things you have left are one thing (well, three things). But it can often feel like you are on the hamster wheel of simple doing and doing and doing what’s next, next next.

Looking back at an empty task list at the end of a day/week is not the same thing as looking back at a list of material things you did complete and feeling pride, rather than dread, at the volume of things on that list.

My theory was to hack around this by making a Drafts widget containing a list of these completed items. But it certainly would be a hack.

1 Like

In terms of viewing completed tasks in Todoist, if you wish to do any kind of analysis/create a dashboard, the tried and tested option has been to “write” completed tasks to a Google Sheet using IFTTT/Zapier etc. You can use QUERY to slice and dice as desired. However, the completion date/time is written in a non-standard format so you need to do some formula magic to make it usable.

The major down side of this route, is that it only starts with tasks you complete after switching the mechanism on. No means to get historical data. I think I’ve about 15K completed tasks written to Sheets. Never look at them, though. :grinning:

Does your reply speak to Drafts or just Google Sheets, @TDK_SA90?

I have discovered that Integromat, my workflow automation tool of choice, CAN have sight of Todoist task completions … if you set up Todoist’s “Watch Events” with Integromat via webhook, you can choose “Task completed” as an event type to watch… this means I can send those events anywhere I like - now, can these be used in Drafts to create a doc and then a widget of today’s completed tasks… ?

Are you saying a Google Sheet can be surfaced in Sheets?

I see this script which pulls from Sheets, though I don’t know if this would just update in the background without requiring going into the Drafts doc.

Just Sheets. Sounds that if you are intent on pushing to a Drafts widget, there’s going to be a lot of heavy lifting involved. Personally, I’d stick with Sheets, but can see the appeal of the widget.

Anything that I can see and review easily, to be honest.

By coincidence, someone has gone full tilt on r/todoist with that dashboard. Scares the living daylights out of me, but each to their own. :wink:

Wowza! Google Data Studio is fun like that.
Just want a simple list of the things I did do today/this week.
Thanks for the info.

So to go full circle, if that is the goal, I’d just write completed to a GSheet and then run a few QUERY functions to get a simple summary list of tasks by day/week.

This is the sort of thing you could create in Sheets with IFTTT.