How to get Firebase Data into Google Sheets

After integrating Firebase with your app, now you need reporting. Reporting is very difficult in Firebase. We make it easy and need not be super complicated. In a few minutes, we’ll show you how to get your Firebase data to Google Sheets.

Without writing a single line of code you can automatically pull the latest data from Firebase Cloud Firestore to Google Sheets. All this without sacrificing data security, with our encrypted Google setup and data stored in your private Google Sheet, you can be confident that you are safe. Let me show you how.

Let’s get started. We are going to enable read permission and create a service account key in Firestore.

Step 1: Enable read permission


In the Firestore dashboard, Click on Rules. By default, the “read” and “write” permission will be False. Now, you would need to enable the read permission as True.


Code Snippet :

rules_version = ‘2’;

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read: if true;
      allow write: if false;
    }
  }
}

Step 2: Generate a service account key

  • Click on the Project setting.
  • Go to the service account in the dashboard and generate a new service account key

The Key is downloaded as a JSON file format. Using this you can pull data from Firestore to Google Sheets.

Step 3: Install and Launch Two Minute Reports

Install Two Minute Reports, if you have not done already.

Sign in to any Google Sheet and go to Add-ons -> Get add-ons.

Search for Two Minute Reports and select Install.

Review and accept the permissions necessary to run Two Minute Reports. Two Minute Reports will be installed for you with the e-mail you are sign in to Google Sheets.

Open Google Sheets and go to Extensions -> Two Minute Reports -> Launch.

Step 4: Add a new Data Source

After installing Two Minute Reports go to the Data Source section. We will connect your service account with Two-Minute-Reports here.

  • Go to the Data Sources section.

  • Select Firebase from the drop-down
  • Copy & paste the values of the generated json file we received from the previous step in the text area
  • Press Test Connection and you are now ready to start pulling data

Step 5: Fetch Firestore Data onto Google Sheet

Now that your data source has been connected, you can write your own Firestore queries and start fetching data onto the Google Sheets

Step 6: (Optional) Schedule and e-mail reports

Once you create a report in Google Sheets, you can schedule automatic updates to get real-time data. This feature is convenient for sending emails or refreshing your spreadsheets with live data and using them as a dashboard.

Under the email section, you can enter the recipient’s email ID and save the new schedule.

You can also choose to specify the reporting format. You can insert the sheet content in the email body, attach the selected sheet as a PDF or Excel, or attach the spreadsheet as an Excel file.

Two Minute Reports’ Schedule Refresh feature has further capabilities. Continue reading about this feature: How to Refresh Data Automatically in Google Sheets.”

We hope you found this guide helpful. If you have any questions, please contact our support team at [email protected].

Try Two Minute Reports for Free by installing from the GSuite marketplace, and start managing your SEO tasks in a breeze within Google Sheets. Cheers!

Tags:

Was this helpful?