So I am trying to log files (and their Id) from my Drive to a spreadsheet using Google Apps Script. The problem is that I don't know how to add content to rows of a Google Sheets document.
I know how to log my files and their Id:
var files = DriveApp.getFiles();
while (files.hasNext()) {
var file = files.next();
Logger.log(file.getName());
Logger.log(file.getId());
}
Now I would like to log the Name and Id of my files from one folder to a Google sheet. Does anybody know how to achieve this?