The id()
function returns the current row’s page ID, or the page ID of a specified page. This page ID is a unique string.
id()
id(page)
page.id()
Code language: JavaScript (javascript)
The page ID can also be found at the end of a Notion page’s URL (before any query strings starting with ?
).
id()
outputs a string that is guaranteed to be unique for each page in a database. It is possible for all other properties – including Name – to contain the same value in multiple rows.
Example Formulas
/* Page URL: <https://www.notion.so/thomasfrank/id-c5d67d15854744869cc4a062fb7b1377> */
id() /* Output: c5d67d15854744869cc4a062fb7b1377 */
prop("Related Pages").first().id()
/* Output: c5d67d15854744869cc4a062fb7b1377 */
Code language: JavaScript (javascript)
Example Database
This example database uses the id()
function and string concatenation to return the URL of each page within the database.
![](https://thomasjfrank.com/wp-content/uploads/2023/03/spaces_RJdJj77lj2q3xwMdOCbK_uploads_aEJGnBbxjfKm3aoAk02c_Id-Function-Notion-Formulas-1400x941.webp)
View and Duplicate Database
![](https://www.notion.so/images/meta/default.png)
“URL” Property Formula
"https://www.notion.so/" + id()
Code language: JavaScript (javascript)
This formula concatenates the string “https://www.notion.so/” with the output of the id()
function using the add operator.
Other formula components used in this example:
![](https://thomasjfrank.com/wp-content/uploads/2023/03/Notion-Formula-Reference-by-Thomas-Frank-thumbnail.jpg)