Overview

If you’re doing an analysis for a stakeholder that lives in spreadsheets (FP&A, we’re looking at you), when you share a Smart Report with them, there’s a good chance that the first thing they do is export the data.

We want you to be able to meet your stakeholders where they are. With the push-to-Google Sheets functionality, you can do your entire analysis within Fabi.ai (or even build complex prediction models) and push that data back to a Google Sheets in just a few clicks.

This is also useful functionality if you or your team need to provide regular executive reports in Google Slides and don’t want to deal with the tedious task of copy/pasting data on a weekly basis.

Preparing the DataFrame

Start by creating your Python DataFrame. You can simply write a SQL query using a SQL cell, which will automatically generate a DataFrame as shown in the following screenshot with dataframe1:

sql_to_python_dataframe

Or you can create a DataFrame in Python as shown here:

python_dataframe

In the example above, we’re using a machine learning model to cluster NBA players by certain attributes in order to group them (hint, this feature is great for building custom lead scoring or churn prediction models or A/B test analysis and sharing with non-technical stakeholders).

Configuring Google Sheets

Once you’ve created your DataFrame, click on the DataFrame overflow menu then “Export to Google Sheets”:

export_dataframe_to_google_sheets

Create or open your Google sheet and fill out the information:

  • Sheet URL: Copy and paste the URL from the Google Sheet you want to push data to
  • Worksheet Name: Name of the sheet you’re pushing the data to
  • Push Mode: Whether you want to override the existing spreadsheet on every update or create a new sheet

Then in Google Sheets, click “Share” and copy/paste the Service Account address in the configuration form from Fabi.ai. You’ll need to grant this user edit rights so that Fabi.ai can edit the spreadsheet.

Overriding the existing sheet can make it a bit easier to keep downstream sheets and Google Slides up to date, but creating a new sheet can be good to maintain historical data.

Scheduling updates

Once you’ve created your DataFrame and configured the Google Sheet, don’t forget to schedule and publish the Smart Report, which will determine the refresh frequency of your spreadsheet. For more information on how to publish and schedule reports, see our documention on Building Smart Reports.