function getId(){
var datasets = {0:{ type:'plan', id: 'abcdef123445', cell: 1},1:{type:'bloc', id: 'ghijk6789', cell: 2},2:{ type:'matiere',id: 'lmnopq123465', cell: 3}};
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('MAIN');
for(var i=0;i<Object.keys(datasets).length;i++){
var gid = SpreadsheetApp.openById(datasets[i]['id']).getSheetId().toString();
Logger.log(datasets[i]['type']+' --> '+ datasets[i]['id']+' --> '+ gid);
/*var cell = sheet.getRange(datasets[i]['cell'],2);
cell.setValue(gid);*/
var dataRange = sheet.getRange(datasets[i]['cell'],2,1,2);
var values = [[datasets[i]['id'],gid]];
dataRange.setValues(values);
}
}newfilename "My test"Ah, interesting.But, doesn't that mean that your three spreadsheets end up with lots of sheets with the same name, or do you actually change the name on every upload? Like auto-set the date, or something.
--
You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/e37CIxMI-_w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAGPzzFsiBSq5gu0RD90TPKs6ebGmZ7NVyOazzi8AOvjSwZXK%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.