Random Numbers And Zettel UID Timestamps In Notion
Create A Timestamp UID
If you're a fan of Zettelkasten and a Notion user, you're going to want to play around with timestamps. Here are some common ways Zettel users utilize timestamps, only Notion-fied. (More about the philosophy behind timestamp IDs.)
timestamp(prop("Created"))
Upside to timestamp ID: Creates a unique number ID
The downside to timestamp ID: Does not calculate seconds. Users must wait one minute between the creation of each page. Else, two entries will have the same ID.
Use Timestamp To Generate A Random Number
Yes, it is possible to generate a random number in Notion. You still have to wait a minute between each entry for this one, but at least there's a formula that can return a better-looking number. This random generator isn't perfect but it looks like the best option so far. By the way, I didn't make this. props to this guy.
mod(mod(timestamp(prop("Created Time")) * 100011979 + 500067713, 900066731) * mod(timestamp(now()) * 800067089 + 800068411, 800053967) + 900067309, 900066571)
Timestamp With Other Properties
Long-Form UID Without Tags
If you want a timestamp ID that includes the name of the note or the name of its tag inside the database, use the concat function like so:
concat(format(mod(mod(timestamp(prop("Created Time")) * 100011979 + 500067713, 900066731) * mod(timestamp(now()) * 800067089 + 800068411, 800053967) + 900067309, 900066571)) + prop("Name"))
Alternatively, Eliminate spaces in UID:
concat(format(mod(mod(timestamp(prop("Created Time")) * 100011979 + 500067713, 900066731) * mod(timestamp(now()) * 800067089 + 800068411, 800053967) + 900067309, 900066571)) + replaceAll(slice(prop("Name"), 0, 10), " ", ""))
Long Form UID With Tags And Name
Here, we're going to add another element — a tag, and place it at the end of the UID in brackets.
concat(format(mod(mod(timestamp(prop("Created Time")) * 100011979 + 500067713, 900066731) * mod(timestamp(now()) * 800067089 + 800068411, 800053967) + 900067309, 900066571)) + replaceAll(slice(prop("Name"), 0, 10), " ", "") + "[" + prop("Tag") + "]")
What I Use In My Notes
Below is an example of the same UID with the addition of new symbols based on a tag selection. For instance, in my notes, I categorize everything into:
_overview (the parent note)(O^/)
child_internal (exclusively mental notes)(<"">)
child_external (notes from external sources)([""])
Also, my personal UID eliminates all spaces in the note's title and include only the first 10 characters, in addition to implementation of the above symbols.
if(prop("Tags") == "Internal", concat("<" + format(mod(mod(timestamp(prop("Created Time")) * 100011979 + 500067713, 900066731) * mod(timestamp(now()) * 800067089 + 800068411, 800053967) + 900067309, 900066571)) + replaceAll(slice(prop("Name"), 0, 10), " ", "") + ">"), if(prop("Tags") == "Overview", concat("O^/" + format(mod(mod(timestamp(prop("Created Time")) * 100011979 + 500067713, 900066731) * mod(timestamp(now()) * 800067089 + 800068411, 800053967) + 900067309, 900066571)) + replaceAll(slice(prop("Name"), 0, 10), " ", "")), if(prop("Tags") == "External", concat("[" + format(mod(mod(timestamp(prop("Created Time")) * 100011979 + 500067713, 900066731) * mod(timestamp(now()) * 800067089 + 800068411, 800053967) + 900067309, 900066571)) + replaceAll(slice(prop("Name"), 0, 10), " ", "") + "]"), "")))
*Note: this method will help with the timestamp limitations above. Although the original timestamp may be identical to another, the addition of the name of the note in some variation will aid the randomness.