Best answer

Phantombuster to Zap question

  • 4 August 2020
  • 8 replies

Userlevel 1

Hi Zappers,

I am wanting to fully automate my LinkedIn prospecting and emailing process to cold leads. I use Phantombuster to 

  1. Automatically Connect with Linkedin users
  2. Scrape those users’ emails using Phantombusters discovery service (max 20 emails per day)

I want to automate the import of my leads information into, so that I don’t need to constantly import CSV files. 

Setting up the Zap between these two apps, I don’t have an issue filling out or mapping the information, but I am getting errors because the JSON object contains every single email/lead that I had scraped in the most recent Phantom that was run. 

Other than changing my Phantom to run just a single email per launch, is there a way to get around this? Or are Zaps only able to handle one set of information each run?


Best answer by trevorSkyCiv 24 August 2020, 16:58

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.

8 replies

Userlevel 7
Badge +10

@trevorSkyCiv There’s a possibility that Zapier can handle what you are attempting to do but we’d need more information, a screenshot (with email addresses obfuscated please) or two or more could help.


If the JSON that you are receiving is in the trigger and has multiple objects or an array Zapier should detect this and set the values as line-items. (Zapier’s term for Arrays)

If the second app you are trying to use is not able to handle line items then you will want to use this workaround/hack with a code step that will fire the step once for each item in the array (once for each email in the JSON) 

Userlevel 1

@PaulKortman thanks for the response. I think looking at the workaround/hack you suggested would probably be the way to go, but I am mostly wondering if there is a simpler way and not involve so many different parties. Here is the first part of the Zap, where it is recognizing the Phantom output:

Then I am trying to create a new prospect for each of the emails/profiles that I scraped using the previous Phantom:

When I go to map the prospect’s information from the Phantom results in the JSON to the applicable fields in, it takes the full set of Emails, First Names, Last Names, etc., instead of just the first value. The commas separating each prospects information is circled in blue:


Userlevel 7
Badge +12

Hi @trevorSkyCiv! Thanks for sharing some screenshots of what you’re seeing in. your Zap 🙂

@PaulKortman is right that the information is coming in as line items (an array), so if you’d like to create or update a new contact for each email, you’ll need to use a workaround like the one he suggested. 

Userlevel 1

As a follow up to @PaulKortman workaround:

I have been able to get this workaround to make the Zap functional, with one hiccup: When there is a prospect where Phantombuster cannot scrape the email, Zapier appends the next real email out of that data column to it. 

Thus, all of my prospect Names, Company information, etc., match, but the emails are misaligned. How can I adjust the Javascript given in the workaround article to “continue” past the prospects that do not have emails attached to them? 

Also, what are the Input Data keys? Are they the ones that I identified, e.g., “Email”? Or are they the keys from the imported JSON that I mapped it to, e.g., “mailFromDropContact”?

Userlevel 7
Badge +10

Also, what are the Input Data keys? Are they the ones that I identified, e.g., “Email”? Or are they the keys from the imported JSON that I mapped it to, e.g., “mailFromDropContact”?

The InputData Keys are whatever you put in that code step. Here’s the screenshot from the workaround post where it circles (squares) the Keys in Green, aka names and emails.



The code to change to deal with the empty email address is quite tricky. There could be two things going wrong here, one is as you described where it just grabs the next value in the array, the other (and more likely) is that the first value in the array (for emails in this case) is empty, when this happens Zapier “collapses” the first number of empty values and it messes with the lining up of values. 


The way to determine this is to look at the output from the Phantombuster step (in task history) is it showing 


if it’s starting with a comma “,” then the first email address is blank, if you see a double comma “,,” like between email2 and email3 in the example above then that just means there is an empty value in the array, but not in the first slot.


Zapier respects empty values in the middle of an array (aka not in the first slot) but if there is an empty value in the first spot it will remove that, so the above output would then become:,,,

(notice the first comma is missing, but the double comma still is there -- this is normal Zapier behavior)


Is there anyway you can get Phantombuster to put in “n/a” or something when an email address is not found?

Userlevel 1

Hi @PaulKortman

Thanks again for the reply, I just talked with their support team and they are going to add blank strings for any prospects in which their emails could not be scraped. 

Thanks again!

Userlevel 1

I am stuck in the same issue and realized its related to Phantombuster! How?

If you check the output from Phantombuster “Data Out” section in your zap, the rows that do NOT have email, you won't find an email attribute at all for that record! while if they have an email value you will find the email attribute & its value in the record!

so for a reason or another zapier will always get you the email list shorter than let's say the first name list.

i even checked the JSON output from Phantombuster website if a record doesn't have a “Birthday” for example, the whole attribute won't be available for that record!

that’s my finding so far & i do not have a solution yet, i hope if someone faced this before to help us in this

Userlevel 7
Badge +10

@Gibzy you may want to check out @trevorSkyCiv ‘s other post here: 

It might give more insight into things you can try.