Avoiding Zap Loops#

Some users will want to use Zapier in order to keep two services up to date on the same object, and you might want to use two Zaps that do the same thing in opposite directions to do so. When you do this, you'll want to take steps to avoid a "loop" of duplicate objects when those Zaps are triggered.

This can also happen if you have a single Zap too, where the Action performed on the Zap is also what triggers your Zap. For example, if you had a Gmail Zap which triggers on any new email and an action to send an email. The sent email will be seen as a new email in your account and trigger the Zap making an infinite loop.

Note: this will not enable syncing or updating two records across services, it simply keeps Zapier from performing a non-stop loop between two services.

Let's take the example that I want to sync Salesforce contacts to Google Contacts, and vice versa. If I have one Zap that moves contacts from Salesforce to Google, and another that does the opposite, that means that each time I create a Salesforce contact, it will trigger my first Zap, whose action triggers my second Zap, whose action triggers my first Zap, etc. That can lead to dozens of duplicate contacts if the service doesn't have de-duplication measures through the API.

To fix this, I use filters and make use of fields that I otherwise wouldn't use. I take a look at the available Salesforce trigger fields, and decide that the "Reports To Name" field is one I don't really use.

Salesforce fields

I then create a filter for my Salesforce to Google Zap, telling it to run only when the Reports To field has "#sf" inside. The exact text used isn't important, but this makes it easier for me to remember.

Salesforce filter

Then whenever I create a Salesforce contact, I remember to put in that bit of text in the Reports To field. Now I know that contact will trigger the Zap, and any that come across from Google will not.

Salesforce contact

To completely "close the loop", I do the same thing with my other Zap. I determine the Website field isn't one that I use, so I set up a filter to only run the Zap when that field contains "#ggl". Now when I create Google Contacts, I use that bit of text in that field and can be assured that my Zaps aren't going to duplicate the contact over and over again.

This process can be used for any Zap where the trigger and action are mirrors of each other. The important things to do are:

  • Find fields in both trigger services that you don't use
  • Set up filters for text in those fields
  • Use that text when creating new objects for that trigger

If you follow those steps, you'll never have to worry about a "loop" from those Zaps again.