I’ve been needing to change name of many files. I do use the google drive pack, but it would be very valuable if I could change the old names of files to a new name from the same row of a table.
I’ve searched on google drive pack, but did not find a formula to change name of file.
PS: Currently, I am using Coda AI to find info on a pdf, then I use such info to make a new file name. That is working flawlessly, but as said I could not find a work around to automate renaming the file.
function changeFileName() {
var folderPath = “G:/Meu Drive/1. LeveAgro/3. Contabilidade/NFs ENTRADA/2023/Execução Prosollo/Julho/NFs com Guia de ICMS Não Emitidas”;
var newFileName = “New File Name”;
// Get the folder by its path
var folder = DriveApp.getFolderByPath(folderPath);
// Get all the files in the folder
var files = folder.getFiles();
// Iterate over the files and change the name
while (files.hasNext()) {
var file = files.next();
file.setName(newFileName);
}
}
I have absolutely no knowledge of coding… I love your suggestion on the email, as it is a simple copy and past that I will be able to do - I do actually have a use case for it already. However, adapting it to renaming a file that changes the name using a anme from each row in a table of coda. I am not sure I will be able to do it - limited skills by now. LOL