AdWords
3.8K members online now
3.8K members online now
Dive into advanced features like Remarketing, Flexible Bid Strategies, AdWords Editor, and AdWords Scripts
Guide Me
star_border
Reply

'"DocumentApp" is not defined' in AdWords Script

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I'm trying to create an AdWords Script that outputs information onto a Google Document. However, I am always getting the "DocumentApp" not defined error, even though I have authorised the API. This happens even with the simple code below that I used to check if I was doing something incredibly wrong earlier on:

function main(){
var GoogleDriveDoc = DocumentApp.create("Report")
}

(However, SpreadsheetApp does work)

 

Am I doing something wrong with using DocumentApp, or is this feature of Google Script not supported in AdWords script.

1 Expert replyverified_user

Re: '"DocumentApp" is not defined' in AdWords Script

Top Contributor
# 2
Top Contributor

Hi @Luke S I'm not sure DocumentApp is supported by Scripts.  Have you tried using DriveApp instead?  I'll need to do some testing and will try to get back to you.

 

Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits

'"DocumentApp" is not defined' in AdWords Script

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Not as of yet, however through my quick look at DriveApp, there doesn't seem to be a way to create a 'rich media' report; my end goal is to be able to create a client facing, readable report, and it seems that the main option with creating files with DriveApp is to do it as a text document. I guess I could so something with creating a HTML or XML (for word) file, but that seems to be a quite hacky way of doing it if DocumentApp or an ability to interface with Google Document is available. 

 

Re: '"DocumentApp" is not defined' in AdWords Script

Top Contributor
# 4
Top Contributor

Hi @Luke S I've not had much luck with this so far.  Trying to create a file with the Google document mime type throws an error insisting I use the Advanced Drive Service but there doesn't seem to be any way to enable this for AdWords Scripts.  I'll keep digging.

 

Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits