I am looking for a script like this to pull out the previous versions along with a link to them to put in a google sheet. The goal is to display previous versions and allow others to click on a link to view the previous versions by name.
I found this function here but I am not sure which link in the logs to use to retrieve the old version and display them
function myF() {
// Get the file id
var fileId="FileID"
// Get an array with all the revisions
var revisions = Drive.Revisions.list(fileId);
// Iterate through each revision
for(i=0; i<revisions.items.length;i++){
// Get each revision
var revision = revisions.items[i];
// Log each revision with all its details
Logger.log(revision);
}
}
Which part of the log text shows the link to the previous version(s)
You could do something like this
selflink is a link for file revision, and exportLinks is an array with links for downloading the file revision in specific format (for example pdf, docx, zip etc).