To create a weather widget using Google Sheets, follow these steps:
To begin, create a free Weatherstack account.
Locate your API Access Key, you'll need this shortly.
Make a copy of this Google Sheet template.
In cell
A2
, enter your city as "City, CO
" whereCity
is the name of your city, andCO
is a two-letter code identifier of your state if in the US, or a two-letter code identifier of your country if outside of the US.For a US city, you could enter
New York, NY
. For a city outside the US, you could enterLondon, UK
.
In cell
A5
, paste the API Access Key for Weatherstack that you retrieved earlier.In cell
A9
, enterm
to get the temperature in Celsius orf
to get the temperature in Fahrenheit.Click on the Tools menu and select the option Script editor.
Click on the Trigger menu.
Click the + Add Trigger button in the bottom right corner of the page.
Set a trigger for the myFunction function, which runs from Head on a Time-driven source triggered by an Hourly timer like so:
Return to the script, select the function and then click Run.
Running the script will retrieve (on cells D2
and D3
) the weather for the city you entered on cell A2
on an hourly basis. You can use that weather data and our Spreadsheets data source to build a text widget using the concatenated cell D4
for your dashboard, which will update hourly. Now you'll know if you need the umbrella when you're heading out.