Notion trick: Create a new Google Doc with a particular title in a particular folder

For more than two decades, I’ve been using a desktop-based relational database system for all my project and workflow management. It was getting long in the tooth. I’ve tried other platforms, none of which did everything I needed — I even tried vibe coding my own — before eventually settling on Notion.

But Notion doesn’t do everything I want. Some of the problems are major, like its inability to create PDF invoices (I vibe-coded a tool for this).

Some are minor, like not being able to open a link in a new tab, which I found a work-around for.

A medium-level annoyance is that Notion is bad for word processing, so when I create documents, I do it in Google Docs — and creating these documents takes too many clicks!

I have to go to my Google Drive, create a new document, then go back and forth between it and Notion to copy-and-paste the title, and then I have to put it in the right folder.

I can create a button that says “Create Google Doc” and the link goes to “https://doc.new“. That saves a couple of clicks. But after I press the button, I still have to switch back to the Notion tab, copy the story title, go back to the Google Doc tab, and paste the story title. Then I have to go into “File” and click on “Move” and hunt around for the folder to move the document to.

It’s not that all these steps take time. It’s that they’re annoying. Plus, when I’m in a rush, I forget to put the files in the right folders. I like grouping them all under particular clients, so they don’t get mixed up with all the other stuff I’ve got in my Google Workspace.

Here’s the solution I came up with.

First, get the folder ID number of the Google Drive folder I want to put things into, and find a place to store it inside Notion.

So, for example, I might have a Clients database, and there I might have a property titled “Google Folder ID.”

To get this ID, open the folder in your browser and look at its URL.

For example, in:

https://drive.google.com/drive/u/0/folders/123456789123456789ABCDE

The folder ID would be:

123456789123456789ABCDE

Now go to the database where you’ll be creating the Google Doc. Let’s say it’s an Assignments database. You’ve got your “Assignment Title” property, and you’ve got your “Client” relation property. Create a new rollup property titled “Client ID”, select “Client” as the relation, and “Client ID” as the related property.

Tip: If your Client ID is nested a couple of relations deep, go to the intermediate table and create a new formula property titled, say, “Client ID Formula” and set the formula to just Client ID. Now you’ll be able to reference it from the database you’re working in.

Then create a new formula property in your working database, in my case, Assignments, titled something like “Create New Google Doc”.

The master formula will be the link formula, which is formatted like this:

link("Click here!", "http://www.google.com")

We’re going to replace “Click here!” with the text you want. In my case, “Create New Google Doc.”

And we’re going to replace the Google URL in the example above with this one:

https://docs.google.com/document/create?folder=FOLDERID&title=TITLE

I haveN’T been able to find a hack for adding in starter text, as well, but I guess you can’t have everything…

For “FOLDERID” we’re going to put in the property with the Folder ID in it. And for “Title” we’ll put in the title of our assignment. In my actual database, the title is composed of the publication abbreviation, the year, the month, the story slug, my initials, and the version number, but, for simplicity sake, let’s just say I have an “Assignment Title” property and I’ll use that.

So now my formula becomes:

link("Create New Google Doc", "https://docs.google.com/document/create?folder="+🔍Folder ID+"&title="+🔍Title)

Where 🔍Folder ID and 🔍Title are properties you select in the formula composition pane.

And — ta-da!  I click on the link and it opens a new tab, with a new Google Doc, with the file name already filled it, located in the correct folder.

Yes, this took me a few hours to figure out. Yes, it would have been more efficient to just spend the extra couple of clicks. But I find that when my tools do what I want them to do and save me some hassle, I’m more likely to use them more, and more likely to do things the right way.  Also, each time I figure one of these things out, I get better at using Notion, and more likely to automate even more stuff, which in turn makes me more likely to use Notion… it’s a virtuous cycle at the end of which I am, hopefully, more organized and efficient.

Possible problems

You might have spaces in your title. You will need to replace them with “%2o”s. Use the replaceAll formula, like this:

replaceAll(🔍Title," ","%20")

Your title property might not be a text property but a rollup or something else that doesn’t work in this formula. Use the format formula, which, as far as I can tell, converts everything to plain text. Like this:

format(🔍Title)

Your Google Doc opens under some other user that you’re also logged in as, not in the workspace you want. Add “/u/0” or “/u/1” to the formula — you might need to experiment to figure out which user you actually need. Like this:

link("Create New Google Doc", "https://docs.google.com/document/u/0/create?folder="+🔍Folder ID+"&title="+🔍Title)

You have other weird characters showing up, not just spaces. Here are a few other replaceAll commands you could use:

replaceAll(🔍Title, "%", "%25")
replaceAll(🔍Title, "\n", "%0A")
replaceAll(🔍Title, "\r", "%0D")
replaceAll(🔍Title, ":", "%3A")
replaceAll(🔍Title, "/", "%2F")
replaceAll(🔍Title, "\?", "%3F")
replaceAll(🔍Title, "#", "%23")
replaceAll(🔍Title, "\[", "%5B")
replaceAll(🔍Title, "]", "%5D")
replaceAll(🔍Title, "@", "%40")
replaceAll(🔍Title, "!", "%21")
replaceAll(🔍Title, "\$", "%24")
replaceAll(🔍Title, "&", "%26")
replaceAll(🔍Title, "'", "%27")
replaceAll(🔍Title, "\(", "%28")
replaceAll(🔍Title, "\)", "%29")
replaceAll(🔍Title, "\*", "%2A")
replaceAll(🔍Title, "\+", "%2B")
replaceAll(🔍Title, ",", "%2C")
replaceAll(🔍Title, ";", "%3B")
replaceAll(🔍Title, "=", "%3D")
replaceAll(🔍Title, " ", "%20")
replaceAll(🔍Title, "\"", "%22")
replaceAll(🔍Title, "<", "%3C")
replaceAll(🔍Title, ">", "%3E")
replaceAll(🔍Title, "\\\\", "%5]C")
replaceAll(🔍Title, "\^", "%5E")
replaceAll(🔍Title, "`", "%60")
replaceAll(🔍Title, "{", "%7B")
replaceAll(🔍Title, "\|", "%7C")
replaceAll(🔍Title, "}", "%7D")
replaceAll(🔍Title, "~", "%7E")
replaceAll(🔍Title, "\.", "%2E")