Best answer

Google Drive: search for file, create if doesn’t exist, or replace if does

  • 18 July 2022
  • 3 replies
  • 840 views

Userlevel 1

Hello,

I am trying to do the following: When I new video file comes into VideoAsk, I want to find or create a Google Drive folder named for that user’s email (I can do this fine), then upload/create the file into that Google Drive folder using a special numeric code.  I have made that happen.  But then, if someone answers the same question twice in Videoask, I want to replace the file so I don’t get two copies. So the question is, what is the right order of steps to:

  • When an response comes into Videoask, 
  • Find a folder (create if it doesn’t exist)
  • Upload the new file to Google Drive, or If a file with that name already exists, replace it. 

Somehow I can’t get the right order of steps for that last segment in one zap.  I mostly need someone to explain the logic order here. Like, do I need to build an if/then to this zap?  I would rather not, because I have a few more steps and its my understanding that if you build in if/thens logic (which I have never done) then that has to be the last step of the zap.  Wondering if there is just a simple way to search for file, create if doesn’t exist, or replace if does.  What order of steps would you use for that? 

 

icon

Best answer by Danvers 18 July 2022, 13:35

View original

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

Userlevel 1

Hi there!  That worked!  Thank you.  And I also appreciate the tips about paths being able to have additional steps. Good to know for the future.

Userlevel 7
Badge +12

Hi @JeanneD!

I’ve had a think about this and there is a way to do this without adding logic to the Zap. One thing I will mention before I get into it though is that you can add Paths (branching logic) in a Zap and have steps after that. In the Zap editor it will tell you that you have to add a Paths step at the end of the Zap, but you then add any steps you want after the Paths step. In essence, you have to create the fork before you can tell the Zap what should happen after that. Another quick caveat is that you can add a Filter step in your Zap anywhere at any time, but Filters can only stop a Zap (or let it continue).

Here’s how I would set up the Zap if I wasn’t using Paths/Filters:

  1. VideoAsk trigger
  2. Google Drive Find folder - Select the tickbox in the editor that will create a Folder if none are found.
  3. Google Drive Find File - Search in the folder that was found/created in the previous step to look for a relevant file. Again select the option that will create a file if none are found.
  4. Google Drive Replace File - use the ID of the file that was found or created in the previous step to tell the Zap which file to replace.

 

Let us know if that works for you!

Userlevel 7
Badge +9

So glad to hear this solution worked for you, @JeanneD! 🙌