Question

Python For Loop

  • 28 May 2022
  • 1 reply
  • 147 views

Hi,

 

I have a Zap that does the following:

 

  1. Trigger callback with data (email addresses) sent as an array
  2. Custom code (Python) to loop through the email addresses
  3. LinkedIn Matched Audiences (Action) to send each email address in the list to LinkedIn.

 

When I run the Zap it looks like only 1 email address is being sent from the loop to LinkedIn.

 

Here is my Python code:

 

data = input_data['data']
data_list = data.split (",")
for a in data_list:
return {'email':a}
return {'email':'test@test.com'}

 

Where am I going wrong?

 

Thanks

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +14

Hi @nick_edwards 

Good question.

If you already have an array of email addresses, then you don’t need a Code step.

Try using the Looping app: https://zapier.com/apps/looping/integrations#triggers-and-actions