Could Templater plugin create unique id for every note?

Hi Obsidians. Anybody knows is it possible to automatically create unique ID for every new note (maybe using Templater plugin or any other method).

The idea is that having unique ID for every new note let us hide any nodes in Graph View.
For example: I open Graph View → Filter only “Python notes” → Seeing 117 single notes/nodes on my Graph View → than i want to hide some of that nodes which are not useful at the moment.
Thanks for helping 🙋🏼

2 Likes

I use Templater for this… note the uuid in the below.

For the “title” (note name) I use the Zettlekasten or Daynote setting to have a date/time stamp of my desired format.

---
tags: 
- 
datetime: <% tp.date.now("YYYY-MM-DD ddd HH:mm:ss") %>
uuid: <% tp.user.uuid() %>
---

# [[<% tp.date.now("YYYY-MM-DD ddd") %>]]

## <% tp.date.now("HH:mm:ss") %>

4 Likes

Thank you , but i can’t understand how it works.
There is no info in Documentation about “tp.user.uuid” command.
And copy/paste doesn’t works.
Could you give some details how it works?

1 Like

Sorry… I forgot that it requires another step…

In the “Plugin Options” for Templater, add a “User function” at the bottom…

Name = uuid
Function = uuidgen

Note that this relies on having uuidgen - Linux and Mac has it, or you can install it… not sure about Windows.

Sorry, forgot this had a custom command.

7 Likes

You are genius man! :love_you_gesture::slightly_smiling_face::dart:

2 Likes

One other thing I’ve discovered… I use the Obsidian sync service, so if I have Templater set on my iPad to insert that, even though all the scripts and things don’t work, it puts in the template in the new file.

Then it syncs and my Mac sees it and “populates everything” and it syncs back. So usually in a minute or so, it appears “filled in” on the iPad.

Not perfect, but usable.

4 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.