How to create an automatically updating Google spreadsheet

Tired of finding, copying and pasting data into spreadsheets? With just a few lines of code, you can set up a self-updating spreadsheet in Google Docs that fetches and stores data for you, as this Facebook example shows.

By Sharon Machlis, Computeworld |  IT Management, Google, google docs

Save the date

You'll want to know when the data was fetched and stored. So, put the current date that the function runs in row 1 of your first empty column. This command:

sheet(1,numColumns + 1).setValue(new Date());

will set the value of row 1 of the first column without any data -- cell 1, numColumns + 1 -- to the current date and time.

Then loop through the rest of the cells in the column with your latest data by using the for loop at left.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question