Комментарии:
why is the appscript not working for me? is it because my database url is .app?
ОтветитьThank you bro, much love! It works. August 2023
ОтветитьHi, I have a sheet presenting cities and universities and so on. But when I add a new university with same city name it only shows the last university row in same city. Do you know how to fix that?
ОтветитьI can't choose initialize function. It always shows myFunction. How I solve that?
ОтветитьI want your help sir...after signup the data is shown in firebase database but after refreshing it the data get disapper ....plz give the solution for it what to do ani how to do....plz
ОтветитьWow , amazing tutorial.
How can we convert the data in the firebase to visual analytical data? Like in terms of graphs and charts .
do you know how to export text.exe file to firebase by automatically?
ОтветитьIt cannot save appsscript.json
ОтветитьThis video is wonderful! You are to be congratulated, however I made a small adjustment to the code so that it goes through all the tabs on import.
function getEnvironment() {
var environment = {
spreadsheetID: "replace with your keys",
firebaseUrl: "replace with your keys/",
};
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]);
}
function importSheet(sheet) {
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);
}
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;
}
}
how to connect microsoft excel with firebase ? also what if we want to add multiple files ?
ОтветитьThank you! Solved my issue like a charm, thanks!! Learning lots more from you!
ОтветитьI added an excel file to the previously created project but it is not showing even after i followed your steps sincerely.Please please help and respond asappp
ОтветитьGood job, keep helping others
ОтветитьThanks
Ответитьcan i change the name of sheet1
ОтветитьNice one, worked like a magic.
ОтветитьThanks for tutorial bro.. Good tutorial... ❤️❤️
Ответитьexcellent synchronization of sheet to firebase
but from firebase to sheet it doesn't sync
¿some example?
10x bro, worked like a charm!
ОтветитьThanks for your tutorial 👍
Ответитьi want to import multiple tables
ОтветитьSir if there are multiple excel tables the how we define url of deffrent tables
Ответитьso good
ОтветитьCan it, combined with koldular to load db
Ответитьplease , Can you show us how to retrieve database from Firebase to Google Sheets?
Ответитьmany thanks
Ответить