Renaming Uploaded File Name

Hi Guys

Is there any way of renaming uploaded files. I have checked the Community and can’t find anything that’s helpful.

1 12 3,978
12 REPLIES 12

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Aldrin_Nyamweda

Short answer: no, as far as I know.

Long answer:
Accessing files from appsheet requires indicating the relative path to your file storage, from the default app folder. There is no direct connection such as docId or something similar right now.

However, you can use Apps Script in order to change both the relative file path in the Sheets and the file name in the adequate if you really need to.

Thank you Aurelien for your prompt response. Is it anything that might be added in the future?

No idea, I’m just a community member like you.
Maybe @Steve will have an idea ?

I am unaware of an intention to change file naming behavior.

There are quite a few posts of people asking about this. We really hope it’s a feature that will be implemented soon

Filenames will include the key value of the record, along with a timestamp to ensure the filename is unique. There’s not much that you can do, but you can set some readable text into the key value, which will transfer to the filename. Keep in mind that key values must remain unique too. Here’s something I did the other day for a key value.

LEFT(UNIQUEID() , 4 ) & " " & [employee name]

I tried to enter this formula in Auto Compute>App Formula but can't even upload an image?

Thank you very much for the key value. I changed the file names so everything was the way I wanted it to be.

I realized today that, any filename that starts with a . (period) will retain everything after the last period when uploading.

For example, a file that is named .Some.File.pdf and is being uploaded to a row with key 1234 to a folder named fileStorage will get uploaded as 1234.fileStorage.File.pdf.

That same file with one period, SomeFile.pdf would be uploaded and named 1234.fileStorage.SomeFile.pdf.

I got excited about your discovery there. But I wasn’t able to replicate it. Can you elaborate?

Edit:
Maybe I misread.

Sounds like all you’re saying is that the file extension is kept. I figured that was obvious. What do you mean by “last” period?

You’re indicating that the “File” portion is copied through?

And you’re indicating that the “SomeFile” portion is copied through?

There is no exact pattern that is obvious from your examples, and again, I was unable to replicate.

If you name a file with multiple periods like Some.File.Name.pdf, the platform will upload it as rowkey.Name.pdf.

If you name a file with only one period like .SomeFileName.pdf, it will be uploaded as key.SomeFileName.pdf.

If you specify a storage folder when creating the app, the uploaded filename will also include that folder in the name: key.StorageFolderName.Filename.pdf.

I’m not too sure this would be useful though as it would require your users to always add a period at the start of their filenames and to ensure they only use one period aside from the one preceding the extension.

This image shows the Google spreadsheet, a deck view of the data, and a Widows explorer widow of the folder containing the files uploaded.

With the new integration with Google Apps Script, there is now a way .
See the Tips & Resources below:
How to control or rename uploaded files in a [file] column