In this guide, I'm going to show how to use a timestamp and multiple if statements to create a unique page ID for each page in your database.

Let's start by setting up the database. For this example, we'll assume this is a task database, so we'll add the following properties:

We're going to use if statements in a formula to assign a "code" to each possible choice in the above properties.

It's not necessary to use these exact property types, but, the important thing is, whatever properties you decide to use, they need to be constants, meaning they're not going to be edited down the line, else the page ID will be altered, which defeats the point.

The more properties in your database that you use, the better, as it makes it more likely that each generated page ID will be completely unique.

Let's now go ahead and fill in our options for "Task Type" and "Project," for the purposes of this example, the options will be as follows:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a9eaa775-18f8-406f-9b42-76069bf51836/untitled

Now, going back to the if statements, for each possibility that can be chosen for "Created By," "Task Type," and "Project" we're going to assign a "code" - this could be a number, letter, emoji, however you want your page ID to be formatted, at the end of the day.

For simplicity, we'll use numbers for this example.