Sync Excel data to Firebase Realtime Database || 2022

Sync Excel data to Firebase Realtime Database || 2022

AnishInTech

1 год назад

24,654 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Jezza HokuZai
Jezza HokuZai - 04.09.2023 07:23

why is the appscript not working for me? is it because my database url is .app?

Ответить
Gabriel
Gabriel - 15.08.2023 16:28

Thank you bro, much love! It works. August 2023

Ответить
Berk Kemal
Berk Kemal - 08.08.2023 17:15

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?

Ответить
Dulanja Dilshan
Dulanja Dilshan - 07.08.2023 07:27

I can't choose initialize function. It always shows myFunction. How I solve that?

Ответить
All_Types_Of_Highlights
All_Types_Of_Highlights - 05.08.2023 12:00

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

Ответить
Boniface Osuka
Boniface Osuka - 26.07.2023 15:57

Wow , amazing tutorial.
How can we convert the data in the firebase to visual analytical data? Like in terms of graphs and charts .

Ответить
SABAT Studio
SABAT Studio - 06.07.2023 10:32

do you know how to export text.exe file to firebase by automatically?

Ответить
CAK SODIQ
CAK SODIQ - 30.06.2023 03:48

It cannot save appsscript.json

Ответить
Alisson Albuquerque
Alisson Albuquerque - 08.06.2023 18:58

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;
}
}

Ответить
Mohamed Ayad
Mohamed Ayad - 09.05.2023 03:04

how to connect microsoft excel with firebase ? also what if we want to add multiple files ?

Ответить
·Rose -(⸝⸝º ^ º⸝⸝ )!!!'
·Rose -(⸝⸝º ^ º⸝⸝ )!!!' - 07.05.2023 19:12

Thank you! Solved my issue like a charm, thanks!! Learning lots more from you!

Ответить
malhaar shikhare
malhaar shikhare - 29.04.2023 01:48

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

Ответить
Human
Human - 24.04.2023 22:03

Good job, keep helping others

Ответить
Areeba Saleem
Areeba Saleem - 04.04.2023 03:47

Thanks

Ответить
Devanshu Sharma
Devanshu Sharma - 20.03.2023 11:19

can i change the name of sheet1

Ответить
Joshua Kamara
Joshua Kamara - 15.03.2023 09:29

Nice one, worked like a magic.

Ответить
Azmi Riyadin
Azmi Riyadin - 12.03.2023 19:19

Thanks for tutorial bro.. Good tutorial... ❤️❤️

Ответить
Carbajal
Carbajal - 15.02.2023 02:21

excellent synchronization of sheet to firebase
but from firebase to sheet it doesn't sync
¿some example?

Ответить
Cristian Jimenez
Cristian Jimenez - 18.01.2023 20:25

10x bro, worked like a charm!

Ответить
Mohamad Ardi
Mohamad Ardi - 02.01.2023 10:08

Thanks for your tutorial 👍

Ответить
Khalil Ahmed
Khalil Ahmed - 01.01.2023 15:58

i want to import multiple tables

Ответить
Khalil Ahmed
Khalil Ahmed - 01.01.2023 15:39

Sir if there are multiple excel tables the how we define url of deffrent tables

Ответить
fenbilim_net
fenbilim_net - 07.12.2022 23:57

so good

Ответить
Kuprx Creation
Kuprx Creation - 22.11.2022 22:23

Can it, combined with koldular to load db

Ответить
ismail djennane
ismail djennane - 14.10.2022 06:47

please , Can you show us how to retrieve database from Firebase to Google Sheets?

Ответить
ismail djennane
ismail djennane - 14.10.2022 06:42

many thanks

Ответить