Question

How do I use Zapier to sort new Google Drive folders by name into specific master folders?

  • 21 March 2024
  • 1 reply
  • 6 views

I have  Zap at present which creates a folder on google drive when I add an event in google calendar using the event name as the folder title  and then adds sub folders before setting up a trello card with the same name.

The issue I have is I want to be able to have zapier make the new folder go to a master folder depending on the name.

  • Example . 1 new event in calendar = George White kitchen project
  • zapier creates a folder with the name George White kitchen project in the master folder  G
  • I have the folders of the alphabet already set up
  • so depending on how I name the event it would go to the folder with the corresponding leter of the alphabet eg. White_George  kitchen project would be placed in the master folder W

I’m very new to all this stuff so any help or suggestions would be greatly appreciated


1 reply

Userlevel 7
Badge +11

Welcome to the Community, @Gavmo9! 🎉

There’s a couple approaches you could try:

1) Add branching logic to the Zap - use a filter or paths to check whether the folder name starts with a certain letter to determine which folder it should be added to. The issue with using filters for this is that you’d need to set up a Zap for every single possible master folder. With paths you can have up to 10 paths that contain a maximum of 3 nested paths (paths within a path) so you could handle it within a single Zap.

You can find out more about using filters and paths to add branching logic to Zaps here:


2) Use Formatter and search actions - you could potentially use a Formatter (Text > Extract Pattern) action to extract the first letter of the project name, and use that in a Find a Folder (Google Drive) action to locate the correct folder. Then in your action that creates the folder for the project, in the Parent Folder field you’d select the ID of the folder that’s found by the previous Find a Folder action. This approach is the most efficient of the two in my view.

You could use the \b(\w) pattern for this. That pattern would get the first letter from a project name. For example, the letter E from the project name of Example Project
8e8fe728b0d5daa5f0dba4a307d4a0f9.png

However, I did a quick test and it looks like searching for a folder name that’s only one character long won’t return a match as it needs a longer search value to be supplied. So you’d need to give those folders a longer title. Like “Projects - A”, “Projects - B”, “Projects - C” for example. That way you can select the extracted letter in the folder name you’re searching for like so: 
08bff97b05cf7fd2e2d5b0d5f1b88d88.png
Then you’d use the custom value option in the action that creates the project folder and select the ID of the folder that was found:

d04db6af807d95258adab51a93f5de0c.png

Hope that helps to get you pointed in the right direction. If you run into any issues or questions on the above suggestions do let me know! 🙂

Reply