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 8162517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:44:25+00:00 2026-06-06T18:44:25+00:00

I see there are several posts regarding Cannot set Property and I’m still struggling

  • 0

I see there are several posts regarding “Cannot set Property” and I’m still struggling with pinpointing what I’m missing here. I’m new to Javascript and GAS. I’ve been a book on GAS called, “GScript enterprise application essentials”. This code is from the book and I’m not having success w/ it working. It indicates to run it twice and at one point it did prompt for authorization, which only happened once and i’ve seen this error prior to that and since then. Can anyone suggest a resource or something I can consult to help figure it out.. or maybe understand the error better?? Thanks!!

CODE

/*
* Private for OAuth
* @ returns OAuth headers
*/
DOCS_LIST_API.googleOAuth = function() {
  var oAuthConfig = UrlFetchApp.addOAuthService("google");
oAuthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken? scope=https://docs.google.com/feeds/");
oAuthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken");
oAuthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
oAuthConfig.setConsumerKey('anonymous');
oAuthConfig.setConsumerSecret('anonymous');
return {oAuthServiceName:'google', oAuthUseToken:"always"};
}

var DOCS_LIST_API = {};


/*
* @ args docID String the id for a Google Document
* @ args format String can be, "txt", "odt", "pdf", "html", "rtf", "doc", "png",
"zip"
* @ returns blob
*
*/
DOCS_LIST_API.GdocToFormat = function(docID, format){
var fetchArgs = DOCS_LIST_API.googleOAuth;
fetchArgs.headers = { "GData-Version": "3.0" };
fetchArgs.method = 'get';
var url = 'https://docs.google.com/feeds/download/documents/export/Export?id='+
   docID+'&exportFormat='+format+'&format='+format;
 return UrlFetchApp.fetch(url, fetchArgs);
 }

 // Run it twice
 function doOAuth(){
  try{
    DOCS_LIST_API.GdocToFormat();
     }catch(e){
   }
 }
  • 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-06-06T18:44:27+00:00Added an answer on June 6, 2026 at 6:44 pm

    You get an error because you try to set a property of DOCS_LIST_API before declaring it as a variable.

    Move var DOCS_LIST_API = {}; to the top.

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

Sidebar

Related Questions

There are several rank posts out there but I have yet to see one
I see there is a question here but there is no definite answer. Has
I know, there are several posts with nearly the same question, but all the
There are several questions on StackOverflow regarding closing WCF connections, however the highest ranking
I've read several posts here about ignoring files in Mercurial but I'm stumped on
There are several posts relating to this, but none actually gives a solution. What
I see there are techniques available to have deep models in Backbone, but how
I see there is version 1.5 and 3.0 beta , but I can't seem
I see there are BN_CLICKED and BN_DBLCLK notification messages for a button control. but
I see there are lot's of examples in Ext JS where instead of actually

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.