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
Post a Comment