Clickable Links in Formulas

Clickable Links in Formulas

Master Tag
Tips & Tricks
Created
Jan 9, 2023 09:58 PM
Usage
Web Tags
Formula
Function
Alternatives
Cover
Notion formulas can now be used to create clickable links that make constructing and navigating URL links a breeze. Creating clickable links in Notion formulas only requires inputting the correct code that results in a url syntax (https://www.website.com/…). Below are instructions on how to generate clickable links in Notion formulas for maps, social media searches, Twitter profiles, Wikipedia, Goodreads, and Amazon.
Notion formulas can now be used to create clickable links that make constructing and navigating URL links a breeze. Creating clickable links in Notion formulas only requires inputting the correct code that results in a url syntax (https://www.website.com/…). Below are instructions on how to generate clickable links in Notion formulas for maps, social media searches, Twitter profiles, Wikipedia, Goodreads, and Amazon.
 
1. Generate Map Links
1. Generate Map Links
Generate a link to a map (Google and Apple) from a text property for an address. This formula is compatible with any table that has a text property named "Address."
This Notion formula first checks if the text property "Address" is not empty. If it is not empty, it generates a link to Google Maps, replacing any commas (,) with empty spaces and replacing any spaces ( ) with a + sign. If the "Address" property is empty, the formula generates an empty string.
if(not empty(prop("Address")), "https://www.google.com/maps/place/" + replaceAll(replaceAll(prop("Address"), "[,]", ""), " ", "+"), "")
Google Maps
if(not empty(prop("Address")), "https://www.google.com/maps/dir//" + replaceAll(replaceAll(prop("Address"), "[,]", ""), " ", "+"), "")
Directions
if(not empty(prop("Address")), "https://maps.apple.com/?address=" + replaceAll(replaceAll(prop("Address"), "[,]", ""), " ", "+"), "")
Apple Maps
 
Apartments
Name
Address
Google Maps
2500 East Ave, Rochester, NY 14610
1 Shady Run Ln, Rochester, NY 14625
280 E Broad St, Rochester, NY 14604
 
2. Google and Social Media Searches
2. Google and Social Media Searches
Every title “Name” property in this example is a keyword. The table is designed for copywriters to track trending keywords online. Like above, the following Notion formulas check if the title property "Name" is not empty. If it is not empty, it generates a link to a Google, Google Trends, and Twitter search, replacing any commas (,) with empty spaces and replacing any spaces ( ) with a + sign. If the "Name" property is empty, the formula generates an empty string.
if(not empty(prop("Name")), "https://www.google.com/search?q=" + replaceAll(replaceAll(prop("Name"), "[,]", ""), " ", "+"), "")
Search Google
if(not empty(prop("Name")), "https://trends.google.com/trends/explore?q=" + replaceAll(replaceAll(prop("Name"), "[,]", ""), " ", "+"), "")
Google Trends
if(not empty(prop("Name")), "https://twitter.com/search?q=" + replaceAll(replaceAll(prop("Name"), "[,]", ""), " ", "+"), "")
Search Twitter
 
Keywords
Name
Trending
Search Google
Google Trends
 
3. Twitter Profile Links from Tweets
3. Twitter Profile Links from Tweets
Here are two useful Notion formulas for a saved Tweets database. These formulas are compatible with databases that have a url property named "URL."
The first Notion formula is designed to generate a @-mention text result from a Twitter URL. It checks if a given URL property contains "twitter.com/", then the replace() function replaces the same string "https://twitter.com/" with an empty string, while the second replace() function removes any strings after the username. This leaves the username as the formula result. If the URL does not contain "twitter.com/", an empty string is returned.
if(contains(prop("URL"), "twitter.com/"), "@" + replace(replace(prop("URL"), ".*https://twitter.com/", ""), "/.*", ""), "")
Profile Name (@-Handle)
The second Notion formula generates a link to the profile’s page. For example, if you save a tweet from @NotionHQ, a link will generate to their profile page. This Notion formula first checks if a given URL property contains "twitter.com/". If it does, the replace() function replaces anything after and including "/status" with an empty string. This returns a web url that looks like this: https://twitter.com/username. If the URL does not contain "twitter.com/", an empty string is returned.
if(contains(prop("URL"), "twitter.com/"), replace(prop("URL"), "/status.*", ""), "")
Profile Link
 
Saved Tweets
 
4. Generate Wikipedia Links
4. Generate Wikipedia Links
You can generate helpful links to a Notebook database in Notion too. For example, you may want to research notes further by generating Wikipedia and Google search links based on a note’s title.
Like the above Google and Social media query formulas, this Notion formula checks if the text property "Name" is not empty. If it is not empty, it generates a link to a Wikipedia search portal or Google search, replacing any commas (,) with empty spaces and replacing any spaces ( ) with a + sign. If the "Name" property is empty, the formula generates an empty string.
if(not empty(prop("Name")), "https://en.wikipedia.org/w/index.php?fulltext=1&search=" + replaceAll(replaceAll(prop("Name"), "[,]", ""), " ", "+"), "")
Search Wikipedia
if(not empty(prop("Name")), "https://www.google.com/search?q=" + replaceAll(replaceAll(prop("Name"), "[,]", ""), " ", "+"), "")
Search Google
 
Notebook
 
 
5. Generate Bookshelf Links
5. Generate Bookshelf Links
Generate links for your bookshelf library in Notion including a search for each book in Goodreads. The example below also illustrates a Notion bookshelf with a database view named "To Buy." This view collects all books in the user’s wishlist with a link to buy on Amazon.
Both Notion formula checks if the text property "Name" is not empty. If it is not empty, it generates a link to a Goodreads or Amazon search, replacing any commas (,) with empty spaces and replacing any spaces ( ) with a + sign. If the "Name" property is empty, the formula generates an empty string.
if(not empty(prop("Name")), "https://www.goodreads.com/search?q=" + replaceAll(replaceAll(prop("Name"), "[,]", ""), " ", "+"), "")
Search Goodreads
if(not empty(prop("Name")), "https://www.amazon.com/s?k=" + replaceAll(replaceAll(prop("Name"), "[,]", ""), " ", "+"), "")
Buy on Amazon
 
My Library
Name
Search Goodreads
Status
Wishlist