I am building an integration workflow from a CRM (AmoCRM) into an email platform (UniSender) using Platform UI with Code Mode inserts.
High-level issue: I am getting an array of contacts associated to the same lead. I need to process them all. My understanding is that it’s OK if I only see 1 contact in testing, in deployed Zaps each contact should generate its own task. However, my deployed Zap also only processes the first contact of the array.
How can I have every contact in the array processed? Please help.
Details. The workflow is as follows.
- The lead status in CRM changes. CRM fires a webhook about this change with that lead’s id
- Zapier catches the webhook and asks CRM for id’s of contacts associated to the lead. There may be several, an array is returned.
- For each contact id Zapier gets contact data (firstname, lastname, email).
- This data is sent to UniSender (in theory, in practice I log the details to my Slack channel as a message for debugging).
Here’s the testing of Step 2 in Platrofm UI:
And here, for debugging purposes, the raw contacts list from the same lead:
I have a separate Search Action set up to look up contact details on Step 3, that works fine.
This is the Zap:
When I change the status of a lead that has several contacts, I only get data about one of them:
Any help/tips will be much appreciated ))
Best answer by vshabatView original
Okay, so I found a workaround, assuming that I didn't miss anything and Zapier itself indeed only processes the first element of the array.
It's like this. For each contact in the array I fire a webhook (in the Action code) with that id in the payload. Then I make a separate Zap that catches the webhook and processes it.