Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Sync Google Sheets spreadsheet with the Firebase database?

I want to know if there's any solution to integrate Google Sheets spreadsheet with a Firebase database.

The use case is having a spreadsheet file stored in Google Drive, where I want to automatically sync data with the Firebase database (JSON format), and upon updating the spreadsheet file, I want Firebase to refresh and update the data stored.

like image 922
mesmed Avatar asked Jul 27 '16 10:07

mesmed


People also ask

Can you use Google Sheets as a relational database?

Although Google Sheets is a great spreadsheet, it's not a relational database. Instead, consider a better tool such as Airtable, which allows you to create relational databases in your web browser with up to 1,200 free records (or more with the paid version), using existing templates or your own designs.

Can I connect Excel to Firebase?

Step 1: Authenticate Microsoft Excel and Firebase / Firestore. Step 2: Pick one of the apps as a trigger, which will kick off your automation. Step 3: Choose a resulting action from the other app. Step 4: Select the data you want to send from one app to the other.


1 Answers

Agreed with you @Morfinismo. You might need to listen to edit event from the scripts and then communicate with the firebase from there

/**
 * The event handler triggered when editing the spreadsheet.
 * @param {Event} e The onEdit event.
 */
function onEdit(e) {
  // update firebase from here
}

For more information on setting up googlescript check https://developers.google.com/apps-script/overview

For more information on connecting googlescript with firebase check https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase

like image 169
abubakri olaitan Avatar answered Oct 20 '22 18:10

abubakri olaitan