How to use partial matching in if loop in google apps script -


in problem input number of spreadsheets. loop on these spreadsheets , find particular sheet inside it. said sheet have common prefix. eg setup(xyz). setup word common. need particular sheet. know matchtype cannot used here, please let me know problem of code.

code:

function myfunction() { var ss = spreadsheetapp.openbyid("1kba8twfnx1brjttwsiydtdl"); var sheets = ss.getsheets();  if (sheets.length > 1) {   for( var in sheets){     if((sheets[i].getname()).matchtype.any == "setup(")       {logger.log(sheets[i].getname());        logger.log("hello");       }   logger.log("hello"); } 

}

}

matchtype has never been in javascript. use getname().indexof("setup(")>=0


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -