Rename google drive files within a table

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. :smiling_face_with_tear:

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.

Any one has a solution for that?

Hi @Eduardo_Nunes,

editing is currently not supported, you can only get data - at least with the Google Drive Pack.

If it’s really important to you, you can try a third party app like Zapier, make or n8n or the Coda-API.

Sincerely
Jannis

Hey there!

Another thing you could do is use a simple apps script connected to your coda doc via a button

And rename files that way! Apps script is a perfect use case for this and need like this is why I made this video

This video specifically shows how to use apps script to send gmail with files/attachments but you could deploy an even simpler script to rename a file

You could even use ChatGPT to help write the specific script you need

Let me know if you have questions! You could be up and running in 15 min

Thanks @Jannis , nor Make or Zappier has the option to rename a file.

I might try Axiom.io on Monday, as it can access google drive via web and coda via web.

Not the best solution, but it should get the work done.

I’ve got this from Chatgpt:

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

Thanks for the suggestion though!

1 Like

Okay :+1:

Sincerely,
Jannis

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.