need help on google advance services: Drive.Files.Update -
i'm getting xlsx files erp google drive folder( placing them de drive pc folder) . want them feed master google sheet makes drawings , dynamic tables information files. in master sheet use function importrange(key sheet). need convert xlsx gsheets files. found convert xls files available in folder "google doc spreadsheets"? me solve first problem: "how auto convert files in drive folder automatically" make script de of post above:
function convert() { var carpeta=driveapp.getfolderbyid('idfolder'); aconvertir=carpeta.getfiles(); while(aconvertir.hasnext()){ var archivo=aconvertir.next(); var name=archivo.getname(); var id = archivo.getid(); var xblob = archivo.getblob(); var newfile = { title : name, key : id, "parents": [{"id": "my id parent folder "} ] } file = drive.files.insert(newfile, xblob,{convert: true}); } }
the problem here need update content of files update de content of xlsx. every day i'd run script update gsheets content generated.
once converted files xlsx->gsheets y try update contents of gsheets script:
function pbafor() { xlsx=driveapp.getfolderbyid('folder_with_xlsx').getfiles(); gsheet=driveapp.getfolderbyid('folder_with_gsheets_to_update').getfiles(); while (xlsx.hasnext()) { var xblob=xlsx.next().getblob(); var archdestino = { title: xlsx.next().getname(), } var idreemplazo=gsheet.next().getid(); nvo=drive.files.update(archdestino, idreemplazo, xblob); } }
the problem script update first element of folder_with_gsheets_to_update folder. help??? (note: if try blob,var xblob=xlsx.next().getblob(), if file gsheet apps script shows error on server) xlsx not. thx
Comments
Post a Comment