Getting error " ReferenceError: csv is not defined ". Not able to figure out the reason. Need some help solving this error.
function csvfiletest() { var csv1 = [ ['Alan Walker', 'Singer'], ['Cristiano Ronaldo', 'Footballer'], ['Saina Nehwal', 'Badminton Player'], ['Arijit Singh', 'Singer'], ['Terence Lewis', 'Dancer'] ]; var fileName = 'Orders.csv'; DriveApp.createFile(fileName, csv1, MimeType.text/csv); }
MimeType.text/csv
is MimeType.CSV
. When these points are reflected in your script, it becomes as follows.
DriveApp.createFile(fileName, csv1, MimeType.text/csv);
DriveApp.createFile(fileName, csv1.map(r => r.join(",")).join("\n"), MimeType.CSV);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.