mesmed
mesmed

Reputation: 163

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.

Upvotes: 9

Views: 2686

Answers (2)

user14518353
user14518353

Reputation:

This seems to outline the solution: https://medium.com/firebase-developers/sheets-to-firebase-33132e31935b

As described in the blog post, the 2 will be populated with the same data and seamlessly update as changes are made.

Upvotes: 1

abubakri olaitan
abubakri olaitan

Reputation: 240

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

Upvotes: 1

Related Questions