4

Is it possible to update a Google Spreadsheet using JavaScript from a web page?

Scenario:

1) User lands on web page

2) JS script executes, modifying Google Spreadsheet

How can this be done?

Crashalot
  • 33,605
  • 61
  • 269
  • 439
  • 1
    You can use google app scripts which triggers an event and also we ca use javascript https://developers.google.com/apps-script/ – Jeevan Dongre Jan 12 '13 at 05:08
  • Thanks but it needs to be run on our own web page. – Crashalot Jan 12 '13 at 05:32
  • @Crashalot Javascript can only access the current page, so you can't access Google's spreadsheet pages from your own web page. – Alex W Jan 12 '13 at 05:41
  • 2
    Thanks, @AlexW! We're aware of this, which is why we're asking if any APIs or Google libraries exist to allow JavaScript on external web pages to modify a Google Spreadsheet. – Crashalot Jan 12 '13 at 10:05

1 Answers1

1

It is possible, though I found it difficult. See here for all the details: https://developers.google.com/google-apps/spreadsheets/

If it is a private Google Spreadsheet then you'll need to deal with oAuth 2.0 (Google's authentication). https://developers.google.com/accounts/docs/OAuth2

See here for how to do that with Javascript: http://code.google.com/p/google-api-javascript-client/wiki/Authentication

Josh
  • 3,385
  • 5
  • 23
  • 45