Hi @philthebass
Good question.
Here’s the issue to consider…
If there already exist multiple Files in the GDrive that have a similar name, then the GDrive Find File Zap action (see below) may not return the highest named file.
For example, it may return the first file found, the last file found, the most recently updated file found, etc.
My suggestion to keep this simple would be to append a UNIX timestamp, which will always be unique and incrementing, to the end of the file name.
This serves 3 purposes:
- Makes file names unique
- Makes files auto sort correctly
- Makes files traceable as to when they were first generated/uploaded
Insert the time your Zap runs into a field
Help article: https://zapier.com/help/create/customize/insert-the-time-your-zap-runs-into-a-field
This timestamp displays UNIX time.
Example: 1656689630 5Seconds since Jan 01 1970. (UTC)]
Unix time is a system for describing a point in time.
It is the number of seconds that have elapsed since the Unix epoch, excluding leap seconds.
The Unix epoch is 00:00:00 UTC on 1 January 1970.
Similarly, you can use the Jotform Entry ID returned from the Zap trigger step to make file names unique and ordered.
Hi Troy,
We timestamp the PDF when it’s generated, but the client struggles to read the time stamps, so we’re trying to figure out a way of simplifying the file names appended with 01 02 03 etc.
I think you’re right, there’s no real way of doing that.
I was hoping that Google Drive would allow us to append file names for duplicates (like Mac OS and WIndows does) with (01) (02) etc. but that’s not available as a feature.
I think we’ll have to write some custom code for Gravity forms that counts the number of submissions per user and then appends the file name accordingly.
Thanks again
Phil
@philthebass
There are more advanced ways to achieve this.
e.g. You can log files into an Airtable Base and use that to determine how many of a current file name exist to then get the unique # value to append before upload to GDrive.
Hey, @philthebass
Troy had some great suggestions for dealing with finding the latest file. If you want to auto-increment increment a number, you can use the Storage by Zapier app.
Here’s a basic primer on Storage: https://zapier.com/help/create/storage-and-digests/save-and-retrieve-data-from-zaps
And here’s some use cases, including how to auto-increment: https://zapier.com/help/create/storage-and-digests/storage-examples-in-zaps
I hope this points you in the right direction! Please let me know if you have any other questions.
Thanks @MichelleS - I’ll check that out
Hi there, I wanted to swing by and summarize some of the awesome suggestions here!
If there already exist multiple Files in the GDrive that have a similar name, then the GDrive Find File Zap action (see below) may not return the highest named file.
For example, it may return the first file found, the last file found, the most recently updated file found, etc.
My suggestion to keep this simple would be to append a UNIX timestamp, which will always be unique and incrementing, to the end of the file name.
This serves 3 purposes:
- Makes file names unique
- Makes files auto sort correctly
- Makes files traceable as to when they were first generated/uploaded
Insert the time your Zap runs into a field
Help article: https://zapier.com/help/create/customize/insert-the-time-your-zap-runs-into-a-field
This timestamp displays UNIX time.
Example: 1656689630 6Seconds since Jan 01 1970. (UTC)]
Unix time is a system for describing a point in time.
It is the number of seconds that have elapsed since the Unix epoch, excluding leap seconds.
The Unix epoch is 00:00:00 UTC on 1 January 1970.
Similarly, you can use the Jotform Entry ID returned from the Zap trigger step to make file names unique and ordered.
Michelle also had some great insight to share here:
Troy had some great suggestions for dealing with finding the latest file. If you want to auto-increment increment a number, you can use the Storage by Zapier app.
Here’s a basic primer on Storage: https://zapier.com/help/create/storage-and-digests/save-and-retrieve-data-from-zaps
And here’s some use cases, including how to auto-increment: https://zapier.com/help/create/storage-and-digests/storage-examples-in-zaps
I hope this points you in the right direction! Please let me know if you have any other questions.
Thanks @christina.d - we’ve decided to include the time stamp in the filename for the PDF that is generated by Gravity PDF which should do the trick.
We’re testing it with the client at the moment and will more than likely set it up in production next month.
Amazing, @philthebass! Thanks for keep the thread updated with your solution! Love to see it.