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.

1 Snippets using this method

Explore

Related methods

1 Better Sheets tutorials

Automatic Screenshots in Apps Script

Automatic Screenshots in Apps Script

Related blog posts

Written guides about DriveApp.getUrl().

Browse the blog