Gartner® Hype Cycle™ for Data Management 2024
Read The ReportGartner® Data Management 2024
Read The ReportLEARN HOW TO DEAL WITH SPREADSHEETS AND EFFICIENTLY MATERIALIZE THEIR CONTENT INTO A DATABASE OR A BI TOOL.
I can’t count the number of times I’ve used the phrase: “There’s always a spreadsheet…” When I give a demo of the Keboola platform, I often start with Google Sheets as the data source of choice. The data source connector Google Sheets is one of the most popular components on our platform because, let’s face it, no matter the project, there’s always a spreadsheet involved.
Even internally, we rely on 13 different Google Sheets as secondary data sources. Their uses vary widely from simple lists of our consultants, their current base offices, and time zones to our finance department’s rolling forecast, and many more in between. Our customers have found even more diverse uses, including setting targets, creating custom product hierarchies, and enriching various lists (like locations and personnel) with data not found in their databases.
Spreadsheets are also a useful stop-gap measure when you need to implement a business process not yet supported by primary systems, such as Salesforce, where it should eventually stay. This often happens when you’re still fine-tuning the process and want to iron out the kinks before fully committing to development or acquiring the software that will ultimately manage and provide this data. Just this week, we had to devise a method for our support team to grant free credits to our Freemium customers (you get 60 minutes per month for free on our free plan). Ultimately, this process will be implemented in Salesforce, but for now, a spreadsheet does the job.
Typically, we extract data from the spreadsheet on a schedule, running a flow that pulls data from Google Sheets. This approach works well, but what if you need a specific table updated right away or you need to trigger an update manually? I could go to the Keboola project and run the flow manually, but it’s clear that not everyone who can add rows to the spreadsheet will also have project admin rights. It would be more convenient to push the data from the spreadsheet itself. If only there were a “run upload” button in the sheet itself… But then it hit me – Google Sheets supports scripts, and triggering a flow in Keboola is merely an API call away, assuming you have the right token. So, how challenging could it be to set this up?
After a brief chat with Fisa, our field CTO and my partner in many hacks and crimes, not only did I get confirmation that this was doable, but I also found out that it wasn’t a particularly novel idea. Almost immediately, a script written by our Professional Services team members Leo and David popped up in our Slack thread. From there, it was just a matter of copy-pasting, and about three minutes later…
It worked perfectly!
Since you’ve read this far, I’m guessing you also work with spreadsheets and need to materialize their content into a data warehouse or a BI tool. Maybe you even encounter situations where some transformation or enrichment is required along the way.
I’ll share the script below and guide you through the steps to make this happen.
Click here to get started with a free Keboola project.
In Components, choose the “Google Sheets” data source connector and follow the on-screen prompts to authorize and select your spreadsheet and tab(s).
If your data needs processing – be it simple aggregations or something more complex – the transformation engine is where you should start. In the free account, you can use SQL (running on Snowflake) or Python.
Choose the appropriate data destination connector based on your needs. This could be Snowflake or another database. If you don’t have a destination database yet, the Snowflake data destination connector will set up one for you. Or, it could be Salesforce, or even MailChimp, as not all data tasks revolve solely around BI and analytics.
By now, you should have set up three components in Keboola (or just two if you skipped the transformation step). A flow will consolidate them into a workflow. Create a new flow and, in the “Flow Builder” section, arrange the components in the desired sequence. Since the Google Sheets script will initiate this flow, there’s no need for a scheduled run – unless you want it to run automatically each day.
Now we’ll be switching between Keboola and your Google Sheet, so it’s helpful to have them open side by side. First, in your sheet, navigate to “Extensions” and then “Apps Script” (this will open in a new tab). Name your script, copy the following code block, and paste it there. Save it, then return to your spreadsheet tab and refresh it. You’ll see a new “Keboola” section in the menu.
When it runs for the first time, the script asks you for the Orchestration URL and a token. This is where the copy-pasting between Keboola Connection and the Google Sheet will take place. Follow these steps:
Google Sheets will save the entered URL and token for future use. If you need to change these settings, use the “Reset Settings” option in the Keboola menu to start fresh.
Try it yourself by creating a free account and connecting your data.