Using Router to check conditions

The webhook is getting fed by Lemlist and Linkedin - What I’m looking to do is for the automation to check if the person already exists in Pipedrive - if yes, update the deal with relevant data (if any) or if it doesn’t exist yet (most of the time), create the deal.

How do I setup the router to accomplish this?
To check if the conditions in the previous steps have been met or not.

Thanks!

@M_S Have you looked at the router docs?
https://www.make.com/en/help/modules/router

2 Likes

yes. What I don’t know how to set up is for it to check if the previous steps are true or false.

Welcome to the Make community!

What is the output bundle of module [3]?

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

3 Likes

Hi @M_S ,

After the call to the Pipedrive Search module, there is certainly a “return code” indicating if it is found or not, that’s this “return code” you have to use to drive the Router.

Could you add 2 screenshots of the output bundle:

  • one when it is found
  • one when it is not found.

BR,

PBI

3 Likes

Hi @M_S

You’ve said that you’re looking for the automation to check if the person already exists in Pipedrive - but I don’t see any module that’s searching for a Pipedrive person.

If the existence of the Person is the decision factor for the Router, then you’ll need to search for the Person first.

3 Likes

thanks all for help. Starting to make sense.

@Philippe_Billet yes, this is precisely what I was looking for.
There is ‘result score’ if that’s what you’re referring to?
I would expect it to return either 0 or 1 depending on if there was a match or not.

@DavidGurr_Make
The structure in our Pipedrive is that everything is in deals… so I’m looking for the first and last name in the deal title.

One question - there isn’t a field for the full name. If I search both for first and last name individually, will it return as ‘true’ if either a match in first name or last name is found?
Example: It’s looking for John Doe.
In Pipedrive, there are 3 other Johns. Will the condition be true (because it found a match for first name)?

I will test it with live data tomorrow (will have access to the LinkedIn account) and update this post with the bundle results.

@DavidGurr_Make @Philippe_Billet

This is the bundle

In the router I’m checking for “results score” from the Pipedrive module

But I think I need to do it differently, as it’s not recognizing the variable / the scenario doesn’t run.

I’ve no idea what the Result Score value relates to. It’s something that Pipedrive send back in response to the API call, but their documentation doesn’t define what it means.

Instead, you’d be better using the Total number of bundles value. This is returned by Make - it’s a count of how many hits the Search operation found.

One last point … unless you’re very sure that first name and last name will be spelled exactly the same in both Pipedrive and your data source, and unless you’re also certain that you won’t find duplicates, you might be better searching on something unique such as the email address.

2 Likes

Ah perfect, thanks @DavidGurr_Make

You’re definitely right with searching with something specific.
I wasn’t quite sure how to search for emails, but with searching for company, would I simply map the company value from the webhook to Organisation ID?
Or to Title?


Also, does Make lose (delete) previously collected data?
I run the scenario once to get test data, and with subsequent runs I had the option to use the existing data (which is what I need), but I no longer have the option.

Reading the Pipedrive API docs in more detail, it looks like the Search Deals endpoint only allows you to search by Title, Notes or Custom fields.

You can’t search by contact name, or by company. This is a limitation of the Pipedrive API.

Instead, you’re going to need use either the Search Persons or Search Organizations module first, to get either the Pipedrive Person ID or Organization ID.

You can then use the Search Deals module to return all Deals associated with that ID.

4 Likes

Thanks @DavidGurr_Make
Took some time, finally looked into it properly today.

Some issues I’m facing.
I have the router setup successfully based on if the email address has been found or not.

If not, I need to create the deal… but the output bundle doesn’t match the input.

The deal created doesn’t have any of the needed info (title). Do you know why?
@samliew perhaps you can help here too

Apologies for the delay in responding over the holiday period! I don’t have any easy answer for this I’m afraid.

The only think I can think of is that Pipedrive doesn’t like the Title you’ve specified - but in which case I’d expect their API to throw an error which would be visible in Make.

The Pipedrive API spec makes it clear that the Title is a required field - so it it’s accepted it, it should use it.

I think the best next steps are:

2 Likes