Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7645299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:54:23+00:00 2026-05-31T09:54:23+00:00

In google spreadsheet I see in the address bar that my doc url is

  • 0

In google spreadsheet I see in the address bar that my doc url is https://docs.google.com/spreadsheet/ccc?key=0AuQ7FOvczgvFdHVzRXFKLTF1dHM5dk1qR1VzNGFDNGc#gid=0

However, when I write Browser.msgBox(SpreadsheetApp.getActiveSpreadsheet().getUrl()); in the script I get the following url
https://docs.google.com/spreadsheet/ccc?key=tusEqJ-1uts9vMjGUs4aC4g

Why is there a discrepancy? Which one should I be using for my integrations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:54:24+00:00Added an answer on May 31, 2026 at 9:54 am

    Turns out Google keeps different IDs for the spreadsheet and for the document entity and the one displayed in the address bar is the doc id.

    So if you want to get the doc id you should do the following:

    var file = DocsList.getFileById(SpreadsheetApp.getActiveSpreadsheet().getId());
    Browser.msgBox(file.getId());
    

    Hopefully this will help someone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

https://spreadsheets.google.com/ccc?key=0AnVTJLrKrQo_dE5zdTlKbmxkRk1PU19HUnBlTFBBMWc&hl=en&authkey=CLOYpKoH I'm working on a script that will help me keep track of receipts
I read the tutorial, https://developers.google.com/apps-script/articles/building-sites-app-part2 that uses spreadsheet service in Google sites. The code
I'm trying to add a row to google spreadsheet. They give a source https://developers.google.com/google-apps/spreadsheets/#adding_a_list_row
So I have a Google Form that feeds a Google Docs Spreadsheet. This form
I have a user that created about 50 sheets inside a Google Spreadsheet. Each
I'm making a spreadsheet in Google Docs where i could track my data. I
In Google Docs (which shares many commands with excell and other spreadsheet programs) there
I need to create a webpage quite similar to Google's great Docs spreadsheet, but
I have a Google Spreadsheet with 3 columns that are either blank or have
I have a google spreadsheet that uses this function: =SUM(E:E) - SUM(C:C) It adds

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.