I'm looking for a script to achieve the following. Tried googling few codes but they don't seem to address what I require. And since I'm new to scripts, I'm kind of lost on this.
- Check name listed in "Column H" in google sheet and find matching file in Google Drive (need to give a path).
- If matches, display the hyperlink to the file in "Column I"
- And also the script should check through all the rows in the sheet, and do the above for each row.
- And stop checking if Column "Column K" has as "Complete"
Thank you in advance.
The code I was trying the modify for this is follows;
var searchFor ='title contains "2013"';
var names =[];
var files = DriveApp.searchFiles(searchFor);
while (files.hasNext()) {
var file = files.next();
names.push(file.getName());
}
var folders = DriveApp.searchFolders(searchFor);
while (folders.hasNext()) {
var file = folders.next();
names.push(file.getName());
}
for (var i=0;i<names.length;i++){
Logger.log(names[i]);
}
}```