How to get list of sheets id(s) from specific SpreadSheet with Google Sheets API? -


i can put data in cell, can copyto make new sheet existing sheet.

but when want delete several sheets, need list of sheet id(s)

but don't know how list of sheet id(s) speadsheet?

does know how it?

the following function display sheet names , id's active spreadsheet.

function getsheetid() {   var ss=spreadsheetapp.getactive();   var sh=ss.getactivesheet();   var allsheets=ss.getsheets();   var ids=[];   for(var i=0;i<allsheets.length;i++)   {     ids[allsheets[i].getname()]=allsheets[i].getsheetid();   }   var s='<table width="100%">';   for(key in ids)   {       s+=utilities.formatstring('<tr><td><strong>sheet name</strong></td><td>%s</td><td><strong>sheet id</strong></td><td>%s</td></tr>',key,ids[key]);   }   s+='</table>'   var userinterface=htmlservice.createhtmloutput(s).setwidth(800).setheight(450);   spreadsheetapp.getui().showmodelessdialog(userinterface, 'sheet keys spreadsheet: ' + ss.getname()) } 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -