Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sync a Google Sheets spreadsheet to a Firebase Realtime database
{
"timeZone": "America/Los_Angeles",
"dependencies": {
"libraries": [{
"userSymbol": "FirebaseApp",
"libraryId": "1hguuh4Zx72XVC1Zldm_vTtcUUKUA6iBUOoGnJUWLfqDWx5WlOJHqYkrt",
"version": "29",
"developmentMode": true
}]
},
"exceptionLogging": "STACKDRIVER",
"oauthScopes": ["https://www.googleapis.com/auth/firebase.database", "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/script.scriptapp", "https://www.googleapis.com/auth/script.external_request"],
"executionApi": {
"access": "DOMAIN"
}
}
/**
* Copyright 2019 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*/
function getEnvironment() {
var environment = {
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>",
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>"
};
return environment;
}
// Creates a Google Sheets on change trigger for the specific sheet
function createSpreadsheetEditTrigger(sheetID) {
var triggers = ScriptApp.getProjectTriggers();
var triggerExists = false;
for (var i = 0; i < triggers.length; i++) {
if (triggers[i].getTriggerSourceId() == sheetID) {
triggerExists = true;
break;
}
}
if (!triggerExists) {
var spreadsheet = SpreadsheetApp.openById(sheetID);
ScriptApp.newTrigger("importSheet")
.forSpreadsheet(spreadsheet)
.onChange()
.create();
}
}
// Delete all the existing triggers for the project
function deleteTriggers() {
var triggers = ScriptApp.getProjectTriggers();
for (var i = 0; i < triggers.length; i++) {
ScriptApp.deleteTrigger(triggers[i]);
}
}
// Initialize
function initialize(e) {
writeDataToFirebase(getEnvironment().spreadsheetID);
}
// Write the data to the Firebase URL
function writeDataToFirebase(sheetID) {
var ss = SpreadsheetApp.openById(sheetID);
SpreadsheetApp.setActiveSpreadsheet(ss);
createSpreadsheetEditTrigger(sheetID);
var sheets = ss.getSheets();
for (var i = 0; i < sheets.length; i++) {
importSheet(sheets[i]);
SpreadsheetApp.setActiveSheet(sheets[i]);
}
}
// A utility function to generate nested object when
// given a keys in array format
function assign(obj, keyPath, value) {
lastKeyIndex = keyPath.length - 1;
for (var i = 0; i < lastKeyIndex; ++i) {
key = keyPath[i];
if (!(key in obj)) obj[key] = {};
obj = obj[key];
}
obj[keyPath[lastKeyIndex]] = value;
}
// Import each sheet when there is a change
function importSheet() {
var sheet = SpreadsheetApp.getActiveSheet();
var name = sheet.getName();
var data = sheet.getDataRange().getValues();
var dataToImport = {};
for (var i = 1; i < data.length; i++) {
dataToImport[data[i][0]] = {};
for (var j = 0; j < data[0].length; j++) {
assign(dataToImport[data[i][0]], data[0][j].split("__"), data[i][j]);
}
}
var token = ScriptApp.getOAuthToken();
var firebaseUrl =
getEnvironment().firebaseUrl + sheet.getParent().getId() + "/" + name;
var base = FirebaseApp.getDatabaseByUrl(firebaseUrl, token);
base.setData("", dataToImport);
}
@gtcdevop

This comment has been minimized.

Copy link

@gtcdevop gtcdevop commented Dec 15, 2019

Screen Shot 2019-12-15 at 19 36 37

Something went wrong with permission, is there any change to be made on code?

@edwinlee

This comment has been minimized.

Copy link
Owner Author

@edwinlee edwinlee commented Dec 17, 2019

In your Firebase URL, you're missing the "/" after .com. Try adding it back and running initialize().

@edwinlee

This comment has been minimized.

Copy link
Owner Author

@edwinlee edwinlee commented Dec 17, 2019

Have you also updated your appsscript.json manifest file to the included snippet?

@Phynal

This comment has been minimized.

Copy link

@Phynal Phynal commented Dec 23, 2019

hey edwinlee!
thank you so much for this info
im using this to link a database to my app made in MIT App Inventor
once i use this script to send info to the firebase database it goes just fine
but it is not formatted in JSON
is there anyway to adjust for that ?
here is a link to the app inventor forum where i have posted screenshots of the error

https://groups.google.com/d/msg/mitappinventortest/Fnc1jHyxcQY/GNaK14kGAQAJ

basically i need to know how to add some kind of code to the loading procedure
that will format the spreadsheet/worksheets to JSON
and send that to the database

lemme kno when you can
thanks so much!

@nowzenith

This comment has been minimized.

Copy link

@nowzenith nowzenith commented Jan 15, 2020

what
why?

@nowzenith

This comment has been minimized.

Copy link

@nowzenith nowzenith commented Jan 15, 2020

i cant fix it help me pls

@edwinlee

This comment has been minimized.

Copy link
Owner Author

@edwinlee edwinlee commented Jan 30, 2020

@jay8t6

This comment has been minimized.

Copy link

@jay8t6 jay8t6 commented Feb 5, 2020

@edwinlee do you have an appscript that imports the data to firestore instead?

@edwinlee

This comment has been minimized.

Copy link
Owner Author

@edwinlee edwinlee commented Feb 6, 2020

@edwinlee

This comment has been minimized.

Copy link
Owner Author

@edwinlee edwinlee commented Feb 20, 2020

@aninska

This comment has been minimized.

Copy link

@aninska aninska commented Mar 18, 2020

Hi!! I'm a math teacher, so i don't know much about coding and those stuff, i'm starting to use app inventor and firebase, and your article in Medium is helping me a lot!! Thank you very much! I'd like to do an app for high school students to learn algebraic language, and so their teachers can follow their improvements in the app and the sheet too..

I'm still looking for any way to associate a different sheet for each teacher registered in the app...

Is there any way to do this from AppInventor? I mean.. the theacher writtes the url of his sheet in a textbox and the app makes the association with the sheet and firebase, the same way we have written in the gs code and in the appsscript.json...

Thank you!!!!

@VeraUvads

This comment has been minimized.

Copy link

@VeraUvads VeraUvads commented Mar 30, 2020

image
why could there be such a problem?
"incorrect value" string 44

@edwinlee

This comment has been minimized.

Copy link
Owner Author

@edwinlee edwinlee commented Apr 1, 2020

@mikalmorello

This comment has been minimized.

Copy link

@mikalmorello mikalmorello commented Apr 2, 2020

Is there anyway to have data updates in Firebase sync back to the spreadsheet?

@tourBermuda

This comment has been minimized.

Copy link

@tourBermuda tourBermuda commented Apr 2, 2020

@edwinlee do you have any idea what these error mean.

(with the old version of the runtime, data is still pushed to firebase):

Error: 400 - Invalid data; couldn't parse key beginning at 1:971. Key value can't be empty or contain $ # [ ] / or . (line 303, file "Code", project "FirebaseApp")

(with the new version 8 of the runtime ,no data is sent to firebase):

Error: 400 - Invalid data; couldn't parse key beginning at 1:441. Key value can't be empty or contain $ # [ ] / or .
at FirebaseApp_.sendAllRequests(Code:658:11)
at FirebaseApp
.buildAllRequests(Code:520:16)
at baseClass
.setData(Code:292:28)

@VeraUvads

This comment has been minimized.

Copy link

@VeraUvads VeraUvads commented Apr 2, 2020

I've checked, but there is still an error "incorrect value" string 44
Annotation 2020-04-02 160447
image

@mikalmorello

This comment has been minimized.

Copy link

@mikalmorello mikalmorello commented Apr 2, 2020

I've checked, but there is still an error "incorrect value" string 44
Annotation 2020-04-02 160447
image

@VeraUvads For the spreadsheetID, have you tried using just the id (what you have blocked out in yellow) and not the whole url?

@VeraUvads

This comment has been minimized.

Copy link

@VeraUvads VeraUvads commented Apr 2, 2020

@VeraUvads For the spreadsheetID, have you tried using just the id (what you have blocked out in yellow) and not the whole URL?

@mikalmorello Thank you!

@chriskol

This comment has been minimized.

Copy link

@chriskol chriskol commented Apr 11, 2020

Is there any way to modify this to grab from a specific worksheet within the Google Sheet?

@AnantharamanG2

This comment has been minimized.

Copy link

@AnantharamanG2 AnantharamanG2 commented Apr 12, 2020

Exception: Service Spreadsheets failed while accessing document with id . (line 75, file "Code")

Any idea why this could be happening?

@edwinlee

This comment has been minimized.

Copy link
Owner Author

@edwinlee edwinlee commented Apr 14, 2020

@smarks2

This comment has been minimized.

Copy link

@smarks2 smarks2 commented Apr 14, 2020

@edwinlee this was super helpful but I'm getting the error below and was wondering if you had anidea as to what it could be?

ReferenceError: FirebaseApp is not defined (line 90, file "Code")

@Sharkesm

This comment has been minimized.

Copy link

@Sharkesm Sharkesm commented Apr 16, 2020

@smarks2 Check if Firebase library has been loaded with the correct identifier

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented May 4, 2020

it is showing the error : Error: We're sorry, a server error occurred. Please wait a bit and try again. (line 297, file "Code", project "FirebaseApp")

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented May 4, 2020

it is showing the error : Error: We're sorry, a server error occurred. Please wait a bit and try again. (line 297, file "Code", project "FirebaseApp")

i tried few times later but same error occured
help!!!

@Edu1x1

This comment has been minimized.

Copy link

@Edu1x1 Edu1x1 commented May 4, 2020

it is showing the error : Error: We're sorry, a server error occurred. Please wait a bit and try again. (line 297, file "Code", project "FirebaseApp")

i tried few times later but same error occured
help!!!

I ran into a similar issue when using the newer Cloud Firestore database instead of Realtime Firebase. It worked fine after switching to Realtime Database in the google cloud console.

@rayjohndp

This comment has been minimized.

Copy link

@rayjohndp rayjohndp commented May 5, 2020

Hi. I've tried using your code and it works. However if the data came from the google script that I wrote, new data are not reflecting on my firebase db. Can you help me with this? thanks!

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented May 5, 2020

Error: Unauthorized request. (line 297, file "Code", project "FirebaseApp")
I'm getting this error......please help

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented May 7, 2020

Everything is working fine but i need to change the name

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented May 7, 2020

Everything is working fine but i need to change the name

Screenshot (4)

i need to change the "Wed May 06 2020 ......... " to 1,2,3,4,....

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented May 8, 2020

image
why could there be such a problem?
"incorrect value" string 44

you need to use same google account for firebase as that of your google sheets

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented May 8, 2020

Hi. I've tried using your code and it works. However if the data came from the google script that I wrote, new data are not reflecting on my firebase db. Can you help me with this? thanks!

try using trigger
go to edit>current projects trigger>add trigger>(select 'initialize' in the function, and 'on change' in event type)

@Yu-Sen-Wang

This comment has been minimized.

Copy link

@Yu-Sen-Wang Yu-Sen-Wang commented May 14, 2020

Screen Shot 2020-05-14 at 8 55 43 PM

Does anyone know what happened here? I checked that the last trailing slash of my firebase URL was included, but it did not work.
@AyushiJhamb

This comment has been minimized.

Copy link

@AyushiJhamb AyushiJhamb commented May 21, 2020

Error: Unauthorized request. (line 297, file "Code", project "FirebaseApp")
I'm getting this error......please help

I am also getting the same error. Can you help me with this?

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented May 23, 2020

@Ethan-Chew

This comment has been minimized.

Copy link

@Ethan-Chew Ethan-Chew commented May 23, 2020

I have tried both, however it still does not work

Screen Shot 2020-05-14 at 8 55 43 PM

Does anyone know what happened here? I checked that the last trailing slash of my firebase URL was included, but it did not work.

Does anyone know how to fix this? I am also getting the same issue

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented May 25, 2020

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented May 25, 2020

@lahirue

This comment has been minimized.

Copy link

@lahirue lahirue commented May 26, 2020

Screen Shot 2019-12-15 at 19 36 37

Something went wrong with permission, is there any change to be made on code?

The Spreadsheet and the Google Script is not belongs to the same user is the problem for you all guys .
When you have multiple accounts, you forget who is the owner of the spreadsheet and script. Double check the account that you have used in spreadsheet and script

@lahirue

This comment has been minimized.

Copy link

@lahirue lahirue commented May 26, 2020

Screen Shot 2019-12-15 at 19 36 37
Something went wrong with permission, is there any change to be made on code?

The Spreadsheet and the Google Script is not belongs to the same user is the problem for you all guys .
When you have multiple accounts, you forget who is the owner of the spreadsheet and script. Double check the account that you have used in spreadsheet and script

The Spreadsheet and the Google Script is not belongs to the same user is the problem for you all guys .
When you have multiple accounts, you forget who is the owner of the spreadsheet and script. Double check the account that you have used in spreadsheet and script

@lahirue

This comment has been minimized.

Copy link

@lahirue lahirue commented May 26, 2020

I have tried both, however it still does not work

Screen Shot 2020-05-14 at 8 55 43 PM Does anyone know what happened here? I checked that the last trailing slash of my firebase URL was included, but it did not work.

Does anyone know how to fix this? I am also getting the same issue

The Spreadsheet and the Google Script is not belongs to the same user is the problem for you all guys .
When you have multiple accounts, you forget who is the owner of the spreadsheet and script. Double check the account that you have used in spreadsheet and script

@lahirue

This comment has been minimized.

Copy link

@lahirue lahirue commented May 26, 2020

Main problem of this code is , there is no proper code to read the data from the synced Firebase. It return null always

@cbpcanda

This comment has been minimized.

Copy link

@cbpcanda cbpcanda commented May 30, 2020

Hi guys. First of all, I want to thank the author/s of this code. I'm using this feature to integrate my app using app inventor and firebase database. Everything is going well, except that when I fetch data from the firebase where the value has a space on it " ". The word after that will not be fetched. Ex. tag: "Test" value: "Hello World", when I call "Test", it will only display "Hello". I was wondering if there's a workaround. When I tried to put quotation marks on my cells on google sheets it looks like this; tag: "Test" value: ""Hello World"" and when I fetch it, it works perfectly.

@mannian69

This comment has been minimized.

Copy link

@mannian69 mannian69 commented Jun 4, 2020

I'm getting the same problem at -

// Write the data to the Firebase URL
function writeDataToFirebase(sheetID) {
var ss = SpreadsheetApp.openById(sheetID);

I am logged on in the same accounts on firebase, google.

function getEnvironment() {
var environment = {
spreadsheetID: "https://docs.google.com/spreadsheets/d/1FnWY******************IYeLfb498V1qE/edit#gid=0",
firebaseUrl: "https://pil***********ebase.firebaseio.com/"
firebaseError

Help please

@mannian69

This comment has been minimized.

Copy link

@mannian69 mannian69 commented Jun 4, 2020

I changed SpreadsheetApp.openById to SpreadsheetApp.openByUrl in two places and it worked. Will this change much??

if (!triggerExists) {
var spreadsheet = SpreadsheetApp.openBy <changed "Id" to "Url" and it worked> (sheetID);
ScriptApp.newTrigger("importSheet")
.forSpreadsheet(spreadsheet)
.onChange()
.create();
}
}

// Write the data to the Firebase URL
function writeDataToFirebase(sheetID) {
var ss = SpreadsheetApp.openByUrl(sheetID);
SpreadsheetApp.setActiveSpreadsheet(ss);
createSpreadsheetEditTrigger(sheetID);
var sheets = ss.getSheets();
for (var i = 0; i < sheets.length; i++) {
importSheet(sheets[i]);
SpreadsheetApp.setActiveSheet(sheets[i]);
}
}

@iamsardorbek

This comment has been minimized.

Copy link

@iamsardorbek iamsardorbek commented Jun 22, 2020

Hi, thanks a lot for sharing this project - makes life less painful.
One problem:
The script is creating the head node which holds the SPREADSHEET ID. I need this step to be skipped, i don't want to have head node like this. What do I need to change in the script for it? @edwinlee
image

@umesh-joshi

This comment has been minimized.

Copy link

@umesh-joshi umesh-joshi commented Jun 25, 2020

I tired the above code. It worked fine. But there is one problem. If I am using today() function in my spreadsheet to get the current date, then its updating the column in spreadsheet but its not updating my Firebase database. Can you help me in this ?

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented Jun 25, 2020

Hi, thanks a lot for sharing this project - makes life less painful.
One problem:
The script is creating the head node which holds the SPREADSHEET ID. I need this step to be skipped, i don't want to have head node like this. What do I need to change in the script for it? @edwinlee
image

In the 3rd last line of importSheet() delete the "+ sheet.getParent().getId()" part

@iamsardorbek

This comment has been minimized.

Copy link

@iamsardorbek iamsardorbek commented Jun 26, 2020

Thank you!
Excellent! @parthpandey2000

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented Jun 26, 2020

I tired the above code. It worked fine. But there is one problem. If I am using today() function in my spreadsheet to get the current date, then its updating the column in spreadsheet but its not updating my Firebase database. Can you help me in this ?

Use today() function in the same script

@umesh-joshi

This comment has been minimized.

Copy link

@umesh-joshi umesh-joshi commented Jun 28, 2020

I tired the above code. It worked fine. But there is one problem. If I am using today() function in my spreadsheet to get the current date, then its updating the column in spreadsheet but its not updating my Firebase database. Can you help me in this ?

Use today() function in the same script

Hi @parthpandey2000 can you tell me where exactly you want me add this function in the script ?

@goodryanboy

This comment has been minimized.

Copy link

@goodryanboy goodryanboy commented Jul 1, 2020

Error: We're sorry, a server error occurred. Please wait a bit and try again. (line 297, file "Code", project "FirebaseApp")
Im using firestore I cant change it to the realtime database

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented Jul 2, 2020

Error: We're sorry, a server error occurred. Please wait a bit and try again. (line 297, file "Code", project "FirebaseApp")
Im using firestore I cant change it to the realtime database

  1. In Appscript.json, replace first url of oauthscopes with "https://www.googleapis.com/auth/datastore"
@manjilgautam

This comment has been minimized.

Copy link

@manjilgautam manjilgautam commented Jul 2, 2020

Is there any way we can real-time sync specific tab of the spreadsheet? This code snipped uses id from URL which will be the same for all the tabs.

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented Jul 2, 2020

Is there any way we can real-time sync specific tab of the spreadsheet? This code snipped uses id from URL which will be the same for all the tabs.

Can you elaborate....... Specific tab or specific column

@manjilgautam

This comment has been minimized.

Copy link

@manjilgautam manjilgautam commented Jul 2, 2020

Is there any way we can real-time sync specific tab of the spreadsheet? This code snipped uses id from URL which will be the same for all the tabs.

Can you elaborate....... Specific tab or specific column

I have a spreadsheet name Test and there are multiple sheets within Test. I want to pull out a specific sheet based on the name of the sheet. Sync based on a specific tab.

@manjilgautam

This comment has been minimized.

Copy link

@manjilgautam manjilgautam commented Jul 2, 2020

Screen Shot 2020-07-02 at 11 44 48 AM

I want to sync test sheet only.

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented Jul 3, 2020

Screen Shot 2020-07-02 at 11 44 48 AM

I want to sync test sheet only.

change you writeDataToFirebase(sheetID)() function accordingly

function writeDataToFirebase(sheetID) {
var ss = SpreadsheetApp.openById(sheetID);
SpreadsheetApp.setActiveSpreadsheet(ss);
createSpreadsheetEditTrigger(sheetID);
var sheets = ss.getSheets();
importSheet("test");
SpreadsheetApp.setActiveSheet("test");
}
/if this doesn't work, try removing double quotes from the parenthesis/

@Socheakhan

This comment has been minimized.

Copy link

@Socheakhan Socheakhan commented Jul 3, 2020

Excuse me, can it be auto sync back from firebase database to spreadsheet ?

@daohuukhanh

This comment has been minimized.

Copy link

@daohuukhanh daohuukhanh commented Jul 14, 2020

@edwinlee do you have any idea what these error mean.

(with the old version of the runtime, data is still pushed to firebase):

Error: 400 - Invalid data; couldn't parse key beginning at 1:971. Key value can't be empty or contain $ # [ ] / or . (line 303, file "Code", project "FirebaseApp")

(with the new version 8 of the runtime ,no data is sent to firebase):

Error: 400 - Invalid data; couldn't parse key beginning at 1:441. Key value can't be empty or contain $ # [ ] / or .
at FirebaseApp_.sendAllRequests(Code:658:11) at FirebaseApp.buildAllRequests(Code:520:16) at baseClass.setData(Code:292:28)

I had a similar issue. I think it happens when you have more than one sheet in your spreadsheet, and one of the sheets that is not the one containing the data you wish to import to firebase has invalid data that cannot be parsed as keys. So I made some changes to the code to only import data from the one sheet that I want, by changing two methods writeDataToFirebase() and importSheet() slightly as follow:

// Write the data to the Firebase URL
function writeDataToFirebase(sheetID) {
var sheet = SpreadsheetApp.openById(sheetID);
SpreadsheetApp.setActiveSpreadsheet(sheet);
createSpreadsheetEditTrigger(sheetID);

importSheet();
}

// Import each sheet when there is a change
function importSheet() {

var ss = SpreadsheetApp.getActiveSpreadsheet();
var dataSheet = ss.getSheets()[x]; //replace x with the number of the order in which the sheet appears on the sheets bar (it starts from 0)
var name = dataSheet.getName();
var data = dataSheet.getDataRange().getValues();
var dataToImport = {};

//the rest if the same
}

After making the above changes, I no longer got the error message and can import data to firebase. I hope this may help you.

@peerapoom

This comment has been minimized.

Copy link

@peerapoom peerapoom commented Jul 15, 2020

Thank you

@sagarwasule

This comment has been minimized.

Copy link

@sagarwasule sagarwasule commented Jul 29, 2020

Can you help me with getting data from firebase and updating it to google sheet, I tried the below but it is not working

`
function getData() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Matches');
var data = getFirebaseData('Matches');

var num = 2;
var range = sheet.getRange("A"+num+":I"+num+"");
for(var i in data) {
var values = [
[ data[i].Id, data[i].MatchNo, data[i].DateTime, data[i].Team1, data[i].Team2, data[i].Team1_Score, data[i].Team2_Score, data[i].Winner, data[i].Man_of_the_Match ]
];

range.setValues(values);
num += 1;
range = sheet.getRange("A"+num+":I"+num+"");

}
}

function getFirebaseData(data) {
var firebaseUrl =
var secret = ;
var base = FirebaseApp.getDatabaseByUrl(firebaseUrl, secret);

var result = base.getData(data);
return result;
}

`

@soportehrm

This comment has been minimized.

Copy link

@soportehrm soportehrm commented Aug 4, 2020

I've tried everything from the tutorial but it doesn't sync, i don't know if i'm missing something (I just copied everything from both but still i don't get nothing from firebase)

@soportehrm

This comment has been minimized.

Copy link

@soportehrm soportehrm commented Aug 4, 2020

image

@emnalkan

This comment has been minimized.

Copy link

@emnalkan emnalkan commented Aug 20, 2020

Hello, data is sent to firebase without any problem. But just the opposite how can I do it? I want firebase to automatically update when changes are made in the spreadsheet. Thank you.

@rutvij0027

This comment has been minimized.

Copy link

@rutvij0027 rutvij0027 commented Nov 4, 2020

TypeError: FirebaseApp.getDatabaseByUrl is not a function (line 85, file "Code")

@rutvij0027

This comment has been minimized.

Copy link

@rutvij0027 rutvij0027 commented Nov 4, 2020

TypeError: FirebaseApp.getDatabaseByUrl is not a function (line 85, file "Code")

anyone help me to sort this out

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented Nov 4, 2020

TypeError: FirebaseApp.getDatabaseByUrl is not a function (line 85, file "Code")

anyone help me to sort this out

Send screenshot of the error alongwith code you've used

@chawakasung

This comment has been minimized.

Copy link

@chawakasung chawakasung commented Nov 12, 2020

Script function not found: mainDismiss

What's going on?

@lf2foce

This comment has been minimized.

Copy link

@lf2foce lf2foce commented Dec 8, 2020

does not work anymore, please help!

@Azkuu

This comment has been minimized.

Copy link

@Azkuu Azkuu commented Dec 31, 2020

how to make it not nested data . anyone can help

@parthpandey2000

This comment has been minimized.

Copy link

@parthpandey2000 parthpandey2000 commented Jan 1, 2021

@Azkuu

This comment has been minimized.

Copy link

@Azkuu Azkuu commented Jan 2, 2021

Yeah how to make the id not outside like the others set data?

@bishalkc

This comment has been minimized.

Copy link

@bishalkc bishalkc commented Jan 14, 2021

And if the problem continues, email me at parthpandey2000@gmail.com, I've a different method too write data in firebase using sheets On Mon, 25 May, 2020, 11:04 am Parth Pandey, parthpandey2000@gmail.com wrote:

Do not include (/) or() in your sheet ID On Sat, 23 May, 2020, 11:41 am Ethan-Chew, @.***> wrote: > @Ethan-Chew commented on this gist. > ------------------------------ > > I have tried both, however it still does not work > > [image: Screen Shot 2020-05-14 at 8 55 43 PM] > https://user-images.githubusercontent.com/44517446/81936786-4db6bf80-9625-11ea-9ae0-62902386e76f.png > > Does anyone know what happened here? I checked that the last trailing > slash of my firebase URL was included, but it did not work. > > Does anyone know how to fix this? I am also getting the same issue > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > https://gist.github.com/85ac9033a133d056a8ded6b74f27f30f#gistcomment-3315143, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/APOKMSXEKDRG53LTUFAZH6DRS5SJFANCNFSM4J3CMMQA > . >

Error: Unauthorized request. (line 297, file "Code", project "FirebaseApp")
I'm getting this error......please help

I am getting the similar error, not sure what I am doing wrong.

I have using the same email on both spreadsheet and firebase, and i have read/write true in database rule. Any help will be highly appreciated

Screen Shot 2021-01-13 at 7 37 35 PM
Screen Shot 2021-01-13 at 7 42 16 PM

@rabinovich2006

This comment has been minimized.

Copy link

@rabinovich2006 rabinovich2006 commented Mar 15, 2021

My code was working perfectly and was fetching data to the firbase realtime database. but now something happened.
and is not fetching anymore and I get error Exception: Invalid argument: id writeDataToFirebase @ Code.gs:49
I did not make any-changes and code was working just fine, all the sudden stoped fetching.
I ch

  1. ecked rules on RT database changed to "true" for write and read.
  2. checked all suggestions here: have a backslash in after Rt link, tried changing ID to URL, tried updating my spreadsheet ID.
  3. I am using the same email for both firebase and google spreadsheets.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment