Active campaign - Update:contact node not working

I am trying to update a custom field in Active Campaign and the only required field in the node is Contact ID. However, I get an error “contact_email_was_not_provided” all the time. And even if I add an email field, still the same message.

What is the error message (if any)?

{

“context”: {

},

“name”: “NodeApiError”,

“cause”: {

“message”: “422 - {“errors”:[{“title”:“Email address is required.”,“detail”:”“,“code”:“field_missing”,“error”:“contact_email_was_not_provided”,“source”:{“pointer”:”/data/attributes/email"}}]}",

“name”: “Error”,

“stack”: “Error: Request failed with status code 422 at createError (/data/node_modules/axios/lib/core/createError.js:16:15) at settle (/data/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/data/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)”

},

“timestamp”: 1663844559914,

“message”: “Your request is invalid or could not be processed by the service”,

“node”: {

“parameters”: {

“resource”: “contact”,

“operation”: “update”,

“contactId”: “={{$json[“id”]}}”,

“updateFields”: {…} // 1 keys

},

“name”: “ActiveCampaign1”,

“type”: “n8n-nodes-base.activeCampaign”,

“typeVersion”: 1,

“position”: [

1780,

280

],

“retryOnFail”: false,

“maxTries”: 2,

“credentials”: {

“activeCampaignApi”: {…} // 2 keys

}

},

“httpCode”: “422”,

“description”: “contact_email_was_not_provided”

}

Please share the workflow

Output of the previous node

{

“cdate”: “2022-09-22T03:05:45-05:00”,

“email”: “[email protected]”,

“phone”: “test phone”,

“firstName”: “test”,

“lastName”: “test”,

“orgid”: “0”,

“orgname”: “”,

“segmentio_id”: “”,

“bounced_hard”: “0”,

“bounced_soft”: “0”,

“bounced_date”: “0000-00-00”,

“ip”: “1113983247”,

“ua”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36”,

“hash”: “78770dd56bec39a71c83bdcd3d4dec45”,

“socialdata_lastcheck”: “0000-00-00 00:00:00”,

“email_local”: “”,

“email_domain”: “test.com.ua”,

“sentcnt”: “2”,

“rating_tstamp”: “2022-09-22”,

“gravatar”: “1”,

“deleted”: “0”,

“anonymized”: “0”,

“adate”: “2022-09-22T05:58:09-05:00”,

“udate”: “2022-09-22T05:57:54-05:00”,

“edate”: “2022-09-22T05:56:07-05:00”,

“deleted_at”: “0000-00-00 00:00:00”,

“created_utc_timestamp”: “2022-09-22 03:05:45”,

“updated_utc_timestamp”: “2022-09-22 05:57:54”,

“created_timestamp”: “2022-09-22 03:05:45”,

“updated_timestamp”: “2022-09-22 05:57:54”,

“created_by”: “0”,

“updated_by”: “0”,

“email_empty”: false,

“mpp_tracking”: “0”,

“scoreValues”: [

“54339”

],

“accountContacts”: [

],

“links”: {

“bounceLogs”: “https://sumsub.api-us1.com/api/3/contacts/57346/bounceLogs”,

“contactAutomations”: “https://sumsub.api-us1.com/api/3/contacts/57346/contactAutomations?limit=1000&orders[lastdate]=DESC”,

“contactData”: “https://sumsub.api-us1.com/api/3/contacts/57346/contactData”,

“contactGoals”: “https://sumsub.api-us1.com/api/3/contacts/57346/contactGoals”,

“contactLists”: “https://sumsub.api-us1.com/api/3/contacts/57346/contactLists”,

“contactLogs”: “https://sumsub.api-us1.com/api/3/contacts/57346/contactLogs”,

“contactTags”: “https://sumsub.api-us1.com/api/3/contacts/57346/contactTags”,

“contactDeals”: “https://sumsub.api-us1.com/api/3/contacts/57346/contactDeals”,

“deals”: “https://sumsub.api-us1.com/api/3/contacts/57346/deals”,

“fieldValues”: “https://sumsub.api-us1.com/api/3/contacts/57346/fieldValues”,

“geoIps”: “https://sumsub.api-us1.com/api/3/contacts/57346/geoIps”,

“notes”: “https://sumsub.api-us1.com/api/3/contacts/57346/notes”,

“organization”: “https://sumsub.api-us1.com/api/3/contacts/57346/organization”,

“plusAppend”: “https://sumsub.api-us1.com/api/3/contacts/57346/plusAppend”,

“trackingLogs”: “https://sumsub.api-us1.com/api/3/contacts/57346/trackingLogs”,

“scoreValues”: “https://sumsub.api-us1.com/api/3/contacts/57346/scoreValues”,

“accountContacts”: “https://sumsub.api-us1.com/api/3/contacts/57346/accountContacts”,

“automationEntryCounts”: “https://sumsub.api-us1.com/api/3/contacts/57346/automationEntryCounts

},

“id”: “57346”,

“organization”: null

}

Hi @Artego, this error would be coming from ActiveCampaign, so only they will be able to confirm for certain what’s wrong with your request.

It does, however, seem like you are using a custom field in your node:

image

Can you try adding ActiveCampaign’s default email field instead and verify whether this changes their response?

image

I gave this a quick go on my end and could update my contacts without providing a new email as well, but perhaps there is some custom logic kicking in in your ActiveCampaign account leading to this error.

Hi @MutedJam. I’ve tried adding ActiveCampaign’s default email field, still the same error.

I’ve also tried using a single Update:contact node with the same data that causes an error and it worked fine. It looks like n8n sends an actual expression and not the value to active campaign in my workflow.
Check out this part of the error:
“message”: “Your request is invalid or could not be processed by the service”,

“node”: {

“parameters”: {

“resource”: “contact”,

“operation”: “update”,

“contactId”: “={{$json[“id”]}}”,

“updateFields”: {…} // 1 keys

={{...}} would just ne the syntax used by n8n to represent expressions internally. I tried reproducing this using a workflow like below:

This test workflow still finished as expected without errors. Are you also running into trouble using a simplified workflow like the one above?

And do all nodes in your flow return the same number of items? If not, is there perhaps a discrepancy between the items arriving on you final ActiveCampaign node (where you read the id of all incoming items using an expression of {{$json["id"]}}) and the items returned by your Google Sheets node (which is referenced in your final ActiveCampaig node through the {{$node["Google Sheets"].json["Stage"]}} expression)?

1 Like

In fact, there was a discrepancy between the items. It works great now. Thanks a lot

1 Like