Answer the question
In order to leave comments, you need to log in
How to do bi-directional data sync between Google Spreadsheets?
Good afternoon. Tell me, is there a way to make bidirectional data synchronization between two Google spreadsheets? Those. the user changes the data in the first table - they change in the second. At the same moment, another user can change the same data in the second table and they should change in the first. If it would be read-only, then it would be decided with the help of IMPORTRANGE ()
I did this: I tracked onEdit, opened a book and changed the values of the second book to the values \u200b\u200bof the first.
try{
var rs = SpreadsheetApp.openByUrl(remoteUrl).getSheetByName(remoteListName);
rs.getRange(row,col,event.range.getValues().length,event.range.getValues()[0].length)
.setValues(event.range.getValues());
SpreadsheetApp.getActiveSpreadsheet().toast("Данные отправлены!");
}catch(err){
Browser.msgBox(JSON.stringify(err));
};
{"message":"Вам не разрешено вызывать пользователя SpreadsheetApp.openByUrl. Необходимые разрешения: https://www.googleapis.com/auth/spreadsheets.",
"name":"Exception",
"fileName":"Код",
"lineNumber":60,
"stack":"\tat Код:60 (onEdit)
"}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question