DTTG shortcut for journaling

I use DTTG for daily notes. To make it easier to launch my daily note, I want a simple shortcut to quickly open a note with todays date (YYYY-MM-DD) as the file name. If it doesn’t already exist, then create a md note and open in DTTG.

I can’t figure out how to set this up in Shortcuts. This is what I have so far but it keeps creating new notes even if a note with todays date already exists. I am probably missing something here. Can anyone help me? Thanks

What is the returned value of just the first action?

It is returning the wrong date. I have a note with todays date (2021-11-05) in my inbox but it still returns 2021-11-03 for some reason.

What have you set up as the parameters for the Current Date, e.g., Short ?

ISO 8601 (time deselected)

JFTR: I tried out the same setup, somewhat simplified in that I used the Inbox for searching, too. Same result. Also when I set the search string to ‘name: <date>’. Also setting the date to ISO and no time.

Running the shortcut for the first time creates an MD file with the name ‘2011-11-05’. Running it a second time should open that document but instead creates a new one with the same name.

Searching for another string (i.e. the name of an existing file in the inbox) works ok. So this is either a timing issue (i.e. the file isn’t created yet when the shortcut is run a 2nd time), but I doubt that since the OP searches in the whole database. Or the search action does not work as expected (some problem with ‘-’ characters?).

Try a custom date instead of the ISO option.
Does that work as expected?

No luck. I know it can work because I’ve used this shortcut successfully in the past. But then it stopped working. I just don’t know when it stopped working or what changed to cause this error.

Did you try it with a hard coded value instead of using the current date option?

Perhaps after you upgraded to iOS 15?

Here it works if I include the date in double quotes. See the first action in the image

1 Like

I was struggling with this in a very similar situation.
All my journal entries are dated like so: 20211106.
I’ve got a few shortcuts that pull data from Podcasts, Health, and other apps and, hopefully, opens the current days’ entry in DTTG.

After a bit of tweaking I found that one issue I was having was in the date format was the difference between yyyyMMdd and yyyymmdd in the custom format. The capitalized MM version works for me.

My _Find in DTTG search in shortcuts is “name:yyyyMMdd”

How do these different versions render 20211107? I don’t quite understand how MM is different from mm for numbers.

Before I started typing this I didn’t know the why but then I did a test in Shortcuts as part of my problem solving. Made a simple Shortcut that grabs the date, formats it two ways yyyymmdd and yyyyMMdd, then spits out the answer.
As you can see from the screen grab below the results aren’t the same.

Of course if I had just googled it I would have eventually found this apple help page and it’s link to the Unicode system and discovered that the simple answer is lower case mm = minutes, upper case MM = months, where the number of MM gives you either numerical or alphabetical months. So, yes that would have been the simple way to solve my problem and answer your question but I got to teach myself something and mess about in Shortcuts.

2 Likes

@rpassino
As a lurker, I found this particular discussion rather interesting.

Could you do me a favor: Once the problem with your shortcut has been resolved, can you post your shortcut here?

I’m a total dunce when it comes to creating shortcuts, and I’ve been looking for ways to do exactly as you intend - use DTTG to create daily journal entries. DTTG does so much and journaling seems to be a logical fit.

Thanks in advance - Tod

@TodW
Not sure if this helps you. Here’s my Journal shortcut.
Day’s Journal Entry

I try to run it when I wake up and then add to it through the day. I have places to track what I’m listening to, watching, and reading.
There’s a table of contents at the top and bottom to Mae navigating the individual records easier.
NB. I use a yyyyMMdd naming system and everything goes into month groups inside year groups. This means I change th destination of the Shortcut at the beginning of each month.
You would have to change the naming convention to match yours and change the destination database and group for it to be created in.

I’ve been making shortcuts that make clipboard entries I can paste into this document t through the day for my exercise, weight, media consumption all with a ## heading so it shows up in the table of contents.

Even if you don’t like my method of journaling you could mess around with this Shortcut and learn a little about them and maybe modify it to your own requirements or just to learn about shortcuts.

1 Like

Thanks.

Let me see if I’m using it correctly:

  • I’ve run it through the setup and permissions.
  • I tap it and it creates a note in DTTG that contains the reading, watching, etc that you programmed in. Those are fine.
  • Now when I want to add a thought or comment about the day, I just go to that note and add a new ### header, then start typing. Okay so far? Have I missed anything?

So if I want each day’s note to be created in a Journal folder rather than in the global inbox, what code would I need to add to your shortcut?

Thanks for your help.

Tod

@TodW
Yeah that’s pretty much it.
The Watching/Listening/Reading sections are set up as Markdown tables. For listening I have a Shortcut that generates a line of text for each podcast I listen to. If you cut and paste this text into a markdown file you’ll see what the table looks like when rendered.

### Listened
||Time|Show|Episode #|Title|
---|:---|:---:|:----|
10:25 AM|‎Podcast|Ep2|_**Blah Blah**_| 
11:27 AM|‎PodcastB|1223|_**Pointlessly long podcast title in an attempt to grab listeners**_|

I use two ## 10:28 AM for the header my daily thoughts entries but you can figure out what two or three does to the table of contents and how you want to see it.

As for modifying the Shortcut:

You need to change the second last entry in the Shortcut that starts with “Create Markdown with the title…”


The last variable, which in this screen grab is “The Journal:202111” would be where you choose your destination folder. Shortcuts is a little fiddly with this bit. Do a long press on that text and you should get a little menu that looks like this

If you choose “Clear” then click in that area again you can choose from a long searchable list of all the places you could store the new file.

Now, if you want to change what is pre-populated in the Journal each day, tap the arrow to the right of “Show More” underneath the highlighted area in the screen grab. You’ll see a text field where all that text exists.

As I mentioned, I update this particular variable every month. It’s a little ritual that helps me gauge my progress and organization. You could just have all the daily entries go into one main folder and organize them later, up to you.

Thank you so much. Your instructions look pretty clear. I’ll work on them later tonight.

You are really generous with your time, and it’s appreciated.

Tod

1 Like

This is an interesting technical discussion and I appreciate you sharing your workflow.

I am also curious, if you don’t mind sharing, how you use this type of daily tracking.

Is it mainly just to go back and see what you were doing on a given day or search on something to see if you read/heard it before?

I’ve been doing a similar kind of journaling for many years as well but like to hear how others use this type of data personally.