Link Search Menu Expand Document
Table of contents
  1. Add to Grocery List
    1. Description
    2. Flow
    3. Building the Flow

Add to Grocery List

Description

This use case is built around a common use case of wanting to be able to quickly add items to a list. For example, a shopping list for groceries where you can check them off in Drafts. We already know how to append to a selected draft using the standard functionality of Doctor Drafts, but by passing in details of which draft we want to append to foregoes the need to manually select it each time, and there is also functionality that lets us add some text to the start of each item. This allows us to add the items as checklist items directly into the draft.

Adding items to your grocery list in Drafts then simply becomes a case of triggering Alfred, typing in the keyword and a few items, and Doctor Drafts takes care of updating the draft for you.

Flow

The flow to do this consists of just three sequential blocks.

add-to-grocery-list - flow

Building the Flow

The first block is an Inputs > Keyword block, and just sets up the keyword we want to use, in this case groc to trigger the flow. It is set to require an argument. This argument will be the grocery items to add to the list in Drafts. As noted in the subtext, you can use “\n” to represent a newline so that you can add multiple items at once.

add-to-grocery-list - 01

The next block is a Utilities > Args and Vars block. This passes through the {query} untouched to the final block, but we are also using it to specify two variables.

The prefix variable is set to “- [ ] ”, and this text will be prefixed before each line item that is to be added to the grocery list.

The UUID variable is the unique identifier for the draft we want to append the grocery items to. You can copy the UUID of a draft in Drafts by right cliicking on the draft in the left selection panel, and selecting Copy > UUID.

add-to-grocery-list - 02

The final step is to link an Outputs > Call External Trigger block. If you select the Workflow Triggers… button, this will allow you to select from the list of available triggers and will populate the Workflow ID and Trigger ID fields, with no risk of typos. Here we are selecting the drappend trigger ID from Doctor Drafts.

add-to-grocery-list - 03

If you take a look at the Flow - drappend page in the Documentation section, it explains how it works, and what variables it expects to be set. Note in the above screenshot that the Pass input as argument and Pass variables options are set. These are critical to this working correctly.