Best answer

Find a File in Google Drive Based on a Variable Name

  • 15 April 2024
  • 3 replies
  • 27 views

Userlevel 1

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.

 

icon

Best answer by Troy Tessalone 15 April 2024, 17:08

View original

3 replies

Userlevel 7
Badge +14

Hi @ninefivefree 

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

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

Userlevel 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.

Userlevel 7
Badge +6

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! 🤗

Reply