Here’s a Google Sheets script that pulls data from a Sheet and then pushes the data from it to the configured Geckoboard custom widgets.
What’s the use case? It’s most likely that your needs for Google Sheets will already be met by using Geckoboard’s native Spreadsheets integration – as you can even pull into a Sheet data from other sources, such as this example from @gidea – https://community.geckoboard.com/t/how-to-get-mixpanel-data-into-spreadsheets-and-then-in-geckoboard
You then might consider this approach if you’d like to use features of Geckoboard’s custom widgets that aren’t available in the Spreadsheets integration, such as some visualization types (e.g. RAG, bullet graph) or you want to fine tune the parameters of the widgets.
At the moment there are some gotchas:
- It supports just funnel, RAG and list widgets (more widgets to come if there is interest, but most likely this will focus on features, widgets, and parameters that aren’t available by default in Geckoboard’s native Spreadsheet integration).
- It pulls from just the active/single sheet
That said, he’s how to use it:
- Start a new Google Sheet and click on Tools > Script editor
- Remove what is there by default and paste in the code from here – https://github.com/jasonmendes/geckoboard-custom-widgets-google-sheets/blob/master/index.gs
- Next set up your sheet in the right format:
- In cell B2 put your Geckoboard API Key, which you can find by click on your initials at the top right corner of your dashboard, then Account
- In the next row put in column A ‘Widget’ and then in column B the Push widget’s key. If you aren’t yet familiar with that, first from your dashboard click Add widget, then find custom widgets from the left side list. Once you’ve chosen the widget type, set the method to Push and copy the key:
- In the next row put in column A ‘Type’ and then in column B the widget type
- In the next rows put the parameters of the widget. For a RAG widget it expects a Value and Text (see here for reference – https://developer.geckoboard.com/#rag), and this add-on expects the Value in column A and the Text in column B
As you can see in the example, it pulls data row by row and splits the rows into groups where it finds the ‘Widget’ and ‘Type’ declarations.
Finally click the play > button from the script editor to run the code. It will ask you to authorize the application and you’ll need to click Allow.
Now check your dashboard. If all goes well you should see the data there!
If you’d like the data to update automatically, click on the Resources menu in the script editor, then Current project’s triggers and set up an automation to run at the frequency you’d like.
Let me know if you need a hand setting it up, if you’d like to see any other widget types or if you have any questions.
Update: I just added the List widget – https://developer.geckoboard.com/#list
It expects the item title in column A, the label in column B, the label color in column C and the description in column D.
Update 2: I added the Map widget – See the post below for more detail