Is DriveApp.getFiles() the equivalent of DocsList.getFiles()?

后端 未结 1 668
清酒与你
清酒与你 2021-01-28 21:19

I am using the importFromCSV script and it ran fine the first time but I got a warning in the script editor that the DocsList.getFiles() is deprecated and should find an alterna

相关标签:
1条回答
  • 2021-01-28 21:38

    Short answer is no

    DocsList returns an array of files while DriveApp returns a file iterator. See documentation here.

    But when I see your code, you don't get the file by name but you use the ID... so you could simplify your code using DriveApp.getFileById('0B2n-RwpLExXnaXRBWG1aT3NLbm8') that will immediately return the right file without iterating or looping...

    0 讨论(0)
提交回复
热议问题