Skip to main content
Answer

Find a File in Google Drive Based on a Variable Name

  • April 15, 2024
  • 3 replies
  • 170 views

I have a zap that sends information to ChatGPT. I want to bring this information over to Google Drive inside of a Google Doc.

First, I want Zapier to look for a file in Google Drive based on a date (20240415 - YYYY/MM/DD). If the file does not exist, I want it to create that file with that file name. If the file does exist, it would append the information from ChatGPT into that Google Doc.

That’s not difficult.

The part that is tricky is that I want the date to be variable. If the Zap is running today (20240415), it should be looking for tomorrow’s date (20240416). Then if the zap runs tomorrow, it should be looking the following day’s date (20240417).

It’s essentially compiling news stories and information for me a day in advanced, but I don’t know how to get that date to be variable. This is all I have so far because I’m stuck on the “Required file name” in Google Drive.

 

Best answer by Troy Tessalone

Hi @ninefivefree 

Add this Zap action: Formatter > Date & Time > Format

https://help.zapier.com/hc/en-us/articles/8496275717261#iso-8601-timestamps-0-1

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • Answer
  • April 15, 2024

Hi @ninefivefree 

Add this Zap action: Formatter > Date & Time > Format

https://help.zapier.com/hc/en-us/articles/8496275717261#iso-8601-timestamps-0-1


Hi @ninefivefree 

Add this Zap action: Formatter > Date & Time > Format

https://help.zapier.com/hc/en-us/articles/8496275717261#iso-8601-timestamps-0-1

I had seen this, but didn’t fully understand how it worked. To clarify for anyone else who finds this post:

{{zap_meta_human_now}} creates a field that can be placed as an input into other areas of your Zap:

 

This will output the date & time the zap ran. In my case, I’d always be running the zap a day in advanced, so I had to add an “expression” of +1 day and select that the format that I wanted for my filename to be “Tomorrow’s date”.

 

Thanks Troy! I appreciate the resources and help.


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • April 16, 2024

That’s awesome @ninefivefree! A huge thanks to Troy for pointing you in the right direction!

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 🤗