Recreate/Copy an existing Google Drive Folder everytime a deal is marked as WON in Pipedrive


New in MAKE. Hope someone can assist us here. We are using Pipedrive as our CRM, and Google Drive as our file storage. In our Google Drive, we have an applicant and sponsor folder that has subfolders inside. What we want to happen is that when a deal is marked as won in Pipedrive, we want to recreate or create a copy of the existing folder template and automatically have the subfolders there. For example: Applicant folder has subfolder A, B & C. and client Applicant - ANJA TORI is marked as won in Pipedrive. Create a folder name under ANJA and copy the template folder for Applicant w/ subfolders.

After this, we want to be able have this folder link automatically save in Pipedrive - custom field GDrive Link, so we can easily share it with the client.

Would this be possible in MAKE? Thank you so much.

Hi @DavidGurr_Make Hope you’re well. I’m wondering if you can help me with this one. Do you happen to know if this is possible in Make? Thanks

Hi Ali.

It’s definitely possible. I’ve not tested any of the following, but it should work!

You’d start with a Pipedrive New Deal Event trigger and filter based on the deal status, only proceeding if it’s won.

First, you’d create the new ANJA folder using the Create a Folder module.

There’s no Google Drive Copy a Folder module (or any underlying Google Drive API endpoint as far as I can see). So you’d need to use the Search for Files/Folders module to return bundles for all subfolders in your Template folder.

Following that, for each subfolder you’d then use the Create a Folder module again to create a folder of the same name under the ANJA folder.

You’d then finish up with a Pipedrive Update a XXXX module (where XXXX is whatever object you’re saving the link on, eg Organization) to save the new folder link in the custom field.

You’d need to take care to only run that once, as everything after the Drive Search for Files/Folders module would run for each subfolder. You wouldn’t want/need to run the Pipedrive update for each of those. So you’d either use an Aggregator module or a filter on the input path to only continue on the last bundle in the group.


Do be sure to let us know how you get on!


Hi David. Thank you so much for this. It’s a great insight. Just to give you more context.
Types of client / Folder in GDrive

  1. Applicant - solo applicants / no sponsor
  2. Employer - applicant that is sponsored by an employer

When they are saved in Pipedrive as a new deal if ‘Employer’ type - a deal will be created with a contact person/applicant and link to an organization/employer.

So these 2 types have different folders in GDrive with subfolders in each.

Next, what we want to happen is when a deal is marked as won > see if it has an org linked >
(1) if none proceed to create a folder inside ‘Applicant’ folder in Gdrive> Folder name: Contact Name (Inside this folder should have the subfolders) Note: The subfolder can range to 5-10 folders
(2) >If with org > proceed to create a folder in ‘Employer’ folder in Gdrive > Folder name: Contact Name_Org Name (Inside this folder should have subfolders)
(3) After folder is created > Copy link & settings should be accessible by anyone > Copy link to ‘Gdrive Folder’ custom field in the Pipedrive Person record.

This is more detailed.
This is the initial setup but I think this is wrong:

Please let me know if this makes sense or if you have any questions. Thanks, @DavidGurr_Make !

Hi Ali.

If I understand rightly, then that looks fine as a start. The only extra thing you’ll need is a filter on the path from the initial trigger to the Search Organizations module so that it only continues under the correct circumstances (I’m assuming you don’t want this to trigger on every new Deal in your CRM).


Hi @DavidGurr_Make The criteria would be when the deal is marked as WON then search org > If with Org create folder A > if not create folder B. Does that we still need this watch deals as initial trigger?

Hi @DavidGurr_Make A little confused on this one. Say we have searched the template folder. We are not saving the new folders in there. We simply need to recopy that template folder for every new deal that is one. But I understand it can’t do the recopy. I don’t seem to understand… Can you please re-explain?


To explain: Everytime there’s a won deal and find that there’s an organization. We need to create a new folder inside the GDrive Org Folder. That new folder inside Org folder created will need to have a title of deal contact person name_organisation name. And under that folder we need to have 5 subfolders inside.

Let’s say we created the folder but in the next module how we create a subfolder from that newly created.

Thanks, @DavidGurr_Make

This is creating a new folder for new deal won

This is calling our template with subfolder

At this point were not sure how to pull up the original folder created to create the subfolder inside

You need a trigger module that will catch updates to your Pipedrive Deals, so yes, you still need the Watch Deals module.

It’s going to look something like this (note - I haven’t tested this scenario, so you’ll likely need to debug!):

You don’t need the Search Organizations module. That searches all Orgs in your Pipedrive instance. You already have the Organization Name available in the output fields from Watch Deals.

The router has three branches rather than two - this is because you want to do the bottom route no matter what. It continues on after either of the top two routes have completed.

The first filter compares the Org name to a null string and continues if it’s not null:

It then creates the new Folder in the Employer folder:

And then stores the ID of the folder in a variable (more on this later):


The next filter compares the Org name to a null string and continues if it is null:

Then it creates the folder in the Applicant folder:

And stores the Folder ID for this path (no image as it’s the same as before).

The last path from the router has no filter on it … it always executes. If you created the routes in this order, then this route will always execute last (you can check the order by right-clicking on the Router and selecting “Order routes”).

The very first step on this path is the Get variable module to retrieve the value of the Folder ID variable. Variable values are available only on the path they’re set on … unless you use a Get variable module to retrieve it (this is a common design pattern in Make when you have a set of steps that you want to run after some alternative routes, as in this case):

Next, you want to mimic the missing “Copy folders” functionality. First, we search for all folders within a Templates folder:

That’s going to return a series of bundles, one for each sub-folder that’s been found. The next module creates a folder with the same name in the target Applicant/Employer folder we created earlier, whose ID we retrieved:

Lastly, you want to save the Folder ID variable value in a custom field (not shown in the following image) on the Pipedrive Person record - confusingly, the Pipedrive API calls the Person ID “value” in this case:

The last thing to note is that there’s a filter before this module so that it only executes after all the sub-folders have been created, using the bundle number from the Search for Files/Folders module. Otherwise, it would run for each subfolder (and use unnecessary operations):


Hi @DavidGurr_Make Thank you very much for this. We’ve been configuring it for a while.

We just have a clarification on this part. We have a different template folder for each - Applicant & With Sponsor. The subfolders in each are different from one another, and are in different location.

Main Applicant folder > Applicant Template Folder with Subfolders
Main Sponsor > Sponsor Template Folder with Subfolders

How will this module cater to those two different folders?

This is on the third router: I can only call one template folder at a time

and then the next step from there is to create folder depending on whether it’s with sponsor or applicant.

Hi @DavidGurr_Make This is the saving of link of the folder created in Pipedrive custom field under person.

What item should we map here to get the link? Again, following my initial question above this reply. There are two template folder types in separate location. How will it know which to pull the link…

Hi Ali.

If the template folder structure is different for each route, then you’ll need to move the two Google Drive modules from the third path and have them on both the first and second paths, after the Create a Folder module.

To answer your last question - in the Pipedrive custom field, you’ll map the Folder ID variable - that’s the Google Drive ID of the folder you created on either of the first two paths, and into which you copied the relevant folders.