0

I have an application that extracs data from google spreadsheet (embedded via iframe) to update a model of a single page app written in Angular + ruby in the backend.

I want to update the Angular model whenever the data in the spreadsheet changes.

Is there any way to know if the data in the spreadsheet has changed to update the Angular model without just checking every few seconds? Something like a OnDataChange event?

Thanks in advance?

JohnnyM
  • 1,273
  • 1
  • 13
  • 26
  • This is possible. Are you able to create a Script to accompany the spreadsheet? Or is your question more about the functionality of AngularJS? I have an answer if you are primarily asking about the spreadsheet app. – rGil May 10 '13 at 01:31
  • It's about the spreadsheet app. I can handle angular once I have a model. – JohnnyM May 10 '13 at 09:55

1 Answers1

2

There is an onEdit event in google apps script: https://developers.google.com/apps-script/understanding_triggers

You can use UrlFetchApp.fetch() to notify your app that it has updated.

eddyparkinson
  • 3,680
  • 4
  • 26
  • 52
  • There are limitations to the `onEdit()` trigger that might matter to you. It really only triggers on manual changes to cell contents. See [this answer](http://stackoverflow.com/a/15234631/1677912) for more info. – Mogsdad May 11 '13 at 04:04