To create a weather widget using Google Sheets, follow these steps:
To begin, create a free weatherstack account.
Make your own copy of this Google Sheet template.
A2, enter your city as "
City, CO" where
Cityis the name of your city and
COis 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 enter
A5, enter your API Access Key for weatherstack (which you can find at https://weatherstack.com/dashboard?logged_in=1).
mto get the temperature in °C or
fto get the temperature in °F
Click on the Tools menu and select the option Script editor.
You'll see a script. Click on the project's trigger's menu.
Click the + Add Trigger button in the bottom right corner of the page.
Set a trigger for the myFunction function, that runs from Head on a Time-driven source that's triggered on an Hourly timer.
Once you set the trigger (and so that you don't have to wait 1 hour to get data), run the script for the first time
That will retrieve (on cells
D3) the weather for the city you entered on cell
A2on an hourly basis. You can use that weather data and our Spreadsheets data source to build a text widget using the concatenated cell
D4for your dashboard that will update hourly.
Now you'll know if you need the umbrella when you're heading out.
There are alternatives to Weatherstack you might want to try. This helpful article reviews several weather APIs that, used in conjunction with Google Sheets' =ImportData() function to retrieve JSON data, can pull detailed weather forecast data to a Google Sheet.