How to Use Notion Formula link() to Build Dynamic URL Per Row
🔍 WiseChecker

How to Use Notion Formula link() to Build Dynamic URL Per Row

You want each row in a Notion database to contain a clickable URL that changes based on the data in that row. Manually typing a URL for every entry wastes time and invites typos. The Notion link() formula function lets you construct a URL dynamically using values from other properties in the same row. This article explains exactly how to use link() to build per-row URLs and what to watch out for.

Key Takeaways: Building Dynamic URLs with Notion link()

  • link(concat(“https://example.com/”, prop(“Slug”))): Combines a static base URL with a dynamic slug property to create a clickable link.
  • Formula property type: The link() function only works inside a formula property — it cannot be used in text or rollup properties.
  • prop(“Property Name”) syntax: References another property in the same row; the property name must match exactly, including spaces and case.

ADVERTISEMENT

What the Notion link() Formula Does and When to Use It

The link() function in Notion formulas returns a clickable URL link. Its syntax is link("URL string") or link(concat(...)) for dynamic construction. Unlike a static URL property, link() lets you assemble the URL from other database properties such as text, number, or select fields.

Common use cases include building profile links from employee IDs, creating issue tracker links from ticket numbers, and generating product detail page URLs from SKU codes. The function works only in a formula property column. You cannot use link() inside a rollup or a relation property.

Before writing the formula, ensure you have at least one other property that contains the dynamic part of the URL. For example, a Text property named “Slug” that holds the last segment of the URL. The formula property will combine that value with a fixed base URL.

Steps to Create a Dynamic Per-Row URL Using link()

  1. Add a property for the dynamic value
    Open your Notion database. Click the + icon in the last column header to add a new property. Choose Text (or Number, Select, etc.) as the type. Name it something descriptive like “Slug” or “TicketID”. Fill in the value for each existing row — for example, “my-first-article” for a blog post slug.
  2. Create a new Formula property
    Click the + icon again in the column header. Select Formula from the property type list. Name it “Dynamic Link” or any label you prefer. A formula editor panel opens on the right side of the window.
  3. Write the link() formula
    In the formula editor, type the following structure:
    link(concat("https://example.com/", prop("Slug")))
    Replace https://example.com/ with your actual base URL. Replace "Slug" with the exact name of the property that contains your dynamic value. The concat() function joins the base URL and the property value into a single string. The link() function wraps that string into a clickable link.
  4. Test the formula with a sample row
    Look at the row you filled with a sample slug. The formula cell should display a blue underlined link. Click it. It should open the URL https://example.com/my-first-article in your browser. If the link does not appear or shows an error, check the property name spelling and the parentheses.
  5. Handle special characters and spaces
    If your dynamic value contains spaces or special characters, use the replace() function inside concat() to format the URL correctly. For example:
    link(concat("https://example.com/", replace(prop("Title"), " ", "-")))
    This replaces spaces with hyphens, producing a clean URL slug.

Alternative: Using a Select or Status Property in the URL

You can also use a Select or Status property as the dynamic part of the URL. The formula works identically because prop() returns the text label of the selected option. For example, if you have a Select property named “Category” with options like “docs” and “blog”, the formula link(concat("https://example.com/", prop("Category"))) generates https://example.com/docs or https://example.com/blog per row.

Alternative: Combining Multiple Properties into One URL

Sometimes a URL requires more than one dynamic segment. Use multiple prop() references inside concat(). Example:
link(concat("https://example.com/", prop("Category"), "/", prop("Slug")))
This produces URLs like https://example.com/blog/my-first-article. Each slash must be included as a separate string argument inside concat().

ADVERTISEMENT

Common Mistakes and Limitations When Using link()

Formula Shows “Invalid Syntax” Error

The most frequent cause is a missing comma between arguments inside concat() or a missing closing parenthesis. Ensure every opening parenthesis has a matching closing parenthesis. Check that property names are surrounded by double quotes and match the actual property name exactly — including spaces and capitalization.

Link Is Not Clickable in Database View

The link() function only produces a clickable link when the formula property is displayed as a column in a table, board, or gallery view. If you embed the formula inside a rollup or a relation, the result is plain text, not a link. Place the formula directly in the database as its own property column.

URL Contains Extra Spaces or Line Breaks

If the source property contains leading or trailing whitespace, the generated URL will break. Use the trim() function to clean the value: link(concat("https://example.com/", trim(prop("Slug")))). This removes spaces at the start and end of the property value.

Link Does Not Open the Correct Page

Verify that the base URL ends with a slash if the dynamic segment immediately follows it. Without the trailing slash, the browser may interpret the entire string as a single path. Example: "https://example.com/" (with slash) vs "https://example.com" (without slash). The slash ensures proper URL construction.

Notion link() vs Other Methods for Dynamic URLs

Item link() Formula Static URL Property Manual Hyperlink in Text
Setup effort One-time formula per database Must paste URL in each row Click + paste per row
Dynamic per row Yes — changes automatically No — each URL is fixed No — each URL is fixed
Error-prone Low — formula applies to all rows High — manual entry risks typos High — manual entry risks broken links
Requires formula knowledge Yes — basic concat() and prop() No No
Works in databases Yes — formula column Yes — URL property column No — only in text blocks

Using the link() formula is the only way to generate per-row URLs automatically without manual editing. It scales to hundreds or thousands of rows with zero extra effort per row.

You now know how to use the link() function with concat() and prop() to build dynamic, clickable URLs for every row in a Notion database. Try combining link() with if() to conditionally show different base URLs based on a status property. For example, link(if(prop("Status") == "Published", concat("https://live.example.com/", prop("Slug")), concat("https://draft.example.com/", prop("Slug")))) routes rows to different domains depending on their status.

ADVERTISEMENT