Hello All.
I am trying to create a Zap using WebHooks by Zapier to import contact data from a connected service (in this case Google Contacts) to a CRM using the CRM’s API. According to the guildelines for using the API detailed here (which are fairly standard), I need to use a POST Request with the data for some attributes (email, phone, address, etc.) requiring an array of objects. Here is where I run into trouble. Below is an example of a simple-yet-complete set of data I would hope to convey:
{
"firstName" : "John",
"lastName": "Smith",
"emails":"
{
"type": "Work",
"address": "johnsmith@google.com",
"isPrimary": false
}
]
}
I was able to get the full Zap working fine with simple json strings. Namely, I could get the contact info from Google Contacts, field map first/last name, prefix, suffix etc. into the POST Request, and then fire the webhook off to the CRMs API. Sure enough, it would give me a success message and add a new contact with that information into my CRM.
After attempting to add the attributes with child attributes however, it would not succeed. I would receive an error from the CRM’s API code 400 and be told to “Please re-map your fields.” After fishing around on support pages, I thought maybe I could use double underscores such as emails__type : “Home” to convey a child attribute, but of course this did not work. I saw that some seemed to have success with adding Code by Zapier elements, but I could not figure this out either. I thought for the longest time I was just formatting everything wrong but when I tried my webhook code with online testing sites the full data set worked fine without hitches and the CRM contact was created. At this point I would’ve moved on from Zapier if another site had all the triggers and sources I needed readily available like they do.
Has anyone else encountered a similar problem? Is it even possible to get Zapier to play nice with arrays and child attributes?
Any help would be appreciated