function writeDataToFirebase() {
var ss = SpreadsheetApp.openById("1LACsj0s3syAa9gvORdRWBhJ_YcXHybjQfHPgw3TLQ6g");
var sheet = ss.getSheets()[0];
var data = sheet.getDataRange().getValues();
var dataToImport = {};
for(var i = 1; i < data.length; i++) {
var firstName = data[i][0];
var lastName = data[i][1];
dataToImport[firstName + '-' + lastName] = {
firstName:firstName,
lastName:lastName,
emailAddress:data[i][2],
semester:data[i][4],
department:data[i][5],
};
}
var firebaseUrl = "https://example-app.firebaseio.com/";
var secret = "secret-key";
var base = FirebaseApp.getDatabaseByUrl(firebaseUrl, secret);
base.setData("", dataToImport);
}
Replace the spreadsheet ID and the firebaseURL and the secret key.
To see the database go to the Firebase dashboard and Click on the Database you can view the database.