

In this example, we pull data from a list that shows Geckoboard's values and beliefs into a Google Sheet. The number shown in the results is the table number you'll need to use. To find the index associated with the table you want to display, mouse over the results until the table you want to display is highlighted.

forEach.call(document.getElementsByTagName("table"), function(x) ).
#New tab for google sheet code
If the website you are importing from includes multiple tables, open your Developer Tools and run the following code in the console: var i = 1. Next, add the following formula into cell A1 and adjust the index field as needed. In this example, we pull data from a table that shows how much $1 USD is worth in a number of other currencies into a Google Sheet.Ĭreate a new Google Sheet, or create a new tab on an existing sheet and give it a name. Index - The index, starting at 1, which identifies which table or list as defined in the HTML source should be returned. Query - Either "list" or "table" depending on what type of structure contains the desired data. The value for URL must either be enclosed in quotation marks or be a reference to a cell containing the appropriate text. URL - The URL of the page to examine, including protocol (e.g. And the syntax requires the following elements. The function is written as =IMPORTHTML(URL, query, index). If this isn't fast enough for your needs, you can run a script and set your own refresh interval. Note: Widgets powered by spreadsheets using the ImportData function refresh approx. Publicly available (by this we mean not requiring authorization and/or login credentials).Īlso, if you’re comfortable using your browser’s developer tools, you can check to see if the ImportHTML function should work for the data you want to use. Readily available on the website’s first load. To import data from a table or list within a website into a Google Sheet using the ImportHTML function, the data needs to be: Once there you can simply use our Spreadsheets data source to display it on your Geckoboard dashboard. The first step is getting the data you need in Google Sheets using ImportHTML. You can use this function to automatically pull data into a Google Sheet and then into Geckoboard. Google Sheets offers a function called ImportHTML that imports data from a table or list within an HTML page.
