class DriveApp method .getUrl()

DriveApp is the Apps Script service.

.getUrl() is the method name you will see after a dot in your code.

What it does

Returns the web link to open a file or folder.

Why it's used

  • Paste a clickable link back into the spreadsheet.
  • Email someone the file link right after you create it.

Common errors

  • Forgetting parentheses on getUrl. Write DriveApp.getUrl(), not DriveApp.getUrl or getUrl by itself.
  • Skipping dots between chained calls. Each step needs a dot, like DriveApp.getFileById(id).getUrl().
  • Adding spaces where they do not belong. Write DriveApp.getUrl(), not DriveApp .getUrl(), DriveApp.getUrl (), or DriveApp . getUrl().
  • Wrong capitalization. Use DriveApp and getUrl, not driveapp or geturl.

Explore

Related methods

Better Sheets tutorials

Automatic Screenshots in Apps Script

Automatic Screenshots in Apps Script

Enter Google Drive File Name Get URL

Enter Google Drive File Name Get URL

Create a simple automation with an installable trigger that allows you t...
Every Google Drive File Created in Last 24 Hours

Every Google Drive File Created in Last 24 Hours

Create a simple report in a Google Sheet that documents every file in yo...
Get Every Editor on Every Google File I Own

Get Every Editor on Every Google File I Own

Get every editor if you're looking for the sheets and documents you've s...
How To Download All Tabs as CSV in a Zip File

How To Download All Tabs as CSV in a Zip File

Download All Tabs as CSV in a Zip File, instead of downloading each one ...
Take Screenshots from URLs in Google Sheets

Take Screenshots from URLs in Google Sheets

Use Screenshot One api to quickly get cached images of Screenshots and t...

Related blog posts

Written guides about DriveApp.getUrl().

Browse the blog