Google drive: filename change after being uploaded
I am brand new at zapier and google apps script. I would like to change the filename that is in the google drive which was uploaded by zapier, to either remove time stamp or change the filename totally.
Currently the filename is "Wed, 24 Feb 2021 23:45:46 +0000 (UTC)Peter White.pdf" I need to either remove the time stamp ending with (utc), or rename it to "240221PeterWhite"
How can I achieve filename change automation?
Page 1 / 1
Hi @Stephanolee
As part of the GDrive Upload File action, a File Name and File Extension can be specified.
@Stephanolee Thanks for the direct message, but I’ll answer your question here so it’s available for anyone else who might be struggling with something similar.
Troy is correct that you can specify a filename on upload, but you can also rename a file by “moving” it in Google Drive. However, I think the larger issue is that you are trying to figure out how to dynamically remove everything before and including the (UTC) in the file name…
So I’m not sure what your trigger or inital steps are, but once you get the file/filename into Zapier you can use a “Formatter > Text > Split Text” step to actually split the text on (UTC) or even on just “)” like I do in the example below.
Essentially what this is doing is splitting the filename into two parts, part 1 is before the ) and part two is after the ). Then you just specify that as the output you only want part 2 (Second segment index) and now you can use that in the input of what to rename the file to.
Please post here if you have follow up questions.
Thank you Paul, I have it set up as you suggested and it tested fine as showing the output as “name” only. but when I run the zap it doesn’t change the filename in my google drive. Do I need to create another zap to produce that output in my google drive? Thanks!
@Stephanolee screenshots of the zap steps would be very helpful, you can use this tool to take screenshots or even gifs of your screen so we can see what the zap is set up like.
I actually was able to fix the original zap to exclude the time stamp so now it is uploading the file with the client name only. Thank you!
Now, Is there a way to create another zap to add a value found inside the document to the filename?
for example, current filename is “StephanoLee.pdf” and within the PDF file content will have ‘Session No.1’
Is there a way to find this value and place it addtionally to the filename? so that it would display “StephanoLee1.pdf”