Google Sheets offers a built-in function called ImportData that can automatically fetch data from a CSV or TSV file available online and add it to your Google Sheet. You can then use that Google Sheet with the Spreadsheets data source in Geckoboard to visualize your data. Continue reading to learn about the syntax of this function and how to use it within a Google Sheet.
ImportData function and syntax
The function is written as IMPORTDATA(url)
. And the syntax requires the following elements:
url
- The URL from which to fetch the .csv or .tsv-formatted data, including protocol (e.g.http://
).The value for
url
must either be enclosed in quotation marks or be a reference to a cell containing the appropriate text.
How to import a CSV or TSV data into a Google Sheet
In this example, we'll use the ImportData function to fetch Bitcoin's historic price and add it to a Google Sheet, which can later be used within Geckoboard to power your widgets.
Export the exchange rate database from Quandl
Quandl helps data analysts save time, effort, and money by providing financial and economic data in the precise format they need. In this example, we'll use data from their API in CSV format. To export a CSV database from Quandl for this example, follow these steps:
Go to Quandl.
Use the Database browser to find Bitcoin's Spot Exchange Rates databases.
Once you find the database you are after, look for its Export Data menu on the right of your screen.
Click on CSV and copy the link for this resource.
Here's the example URL we're using for reference: https://www.quandl.com/api/v3/datasets/BCHARTS/BITFINEXUSD.csv
Import the CSV file into Google Sheets
Open a new Google Sheet.
Add the following formula into cell A1:โ
=IMPORTDATA("https://www.quandl.com/api/v3/datasets/BCHARTS/BITFINEXUSD.csv")
Use Spreadsheets to visualize the data in Geckoboard
With Bitcoin's exchange rate information in your Google Sheet, create a new Spreadsheets widget in Geckoboard to display this information on the dashboard.