HighLevel - Custom Fields Issue - Only 3 Fields updating

Describe the problem/error/question

I’m using HTTPRequest to an Update/Insert Contact.

This is working fine, mostly.

However I’m trying to set quite a few customer fields.

I’ve built an array. So far it has four fields but I need to set more than that.

The weird thing is, however many custom fields I add to the array, it never fully reflects them in its output.

At the time of writing this, I have set two fields. The module is completely ignoring them and setting its own custom field with the value ‘Test’. I have no idea WHICH field it’s setting because it’s turned the name into numbers.

I know it’s not one of the fields I’ve set because earlier, one of them WAS included and I could see the correct value being set. However at that point I was trying to set five fields. It was still setting this ‘Test’ field plus the first two, and ignoring the other two.

Until a few minutes ago, I was trying to set a variety of fields and each time it was ignoring everything and outputting nothing at all for customFields.

I’m at a loss as to what’s going on here.

Here’s an example of what I’m trying to set just now (two fields - both ignored)…

{{ [
{“key”: “contact.enquiry_portal_lead_id”, “field_value”: $json.body.enquiry.portalLeadId},
{“key”: “contact.enquiry_category”, “field_value”: $json.body.enquiry_category}
] }}

In the ‘Result’ window while setting that variable they seem to work fine…
[Array: [{“key”: “contact.enquiry_branch”, “field_value”: “987654”},{“key”: “contact.enquiry_intent”, “field_value”: “APPLICANT_INTENT_BUY”}]]

What is the error message (if any)?

No errors - just completely random results where what I set does not get reflected in the HighLevel response.

Please share your workflow

Share the output returned by the last node

“customFields”: [

{

“id”: “aDpkMOEY4pV9iZtc1fXg”,

“value”: “Test”

}

],

Information on your n8n setup

  • n8n version: Community
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
  • **n8n version: 1.88.0
  • **Database: SQLite
  • **n8n EXECUTIONS_PROCESS setting: own, main
  • **Running n8n via: community
  • Operating system: Ubuntu 22.04

The workflow URL link you shared cannot be accessed except by you. Please edit your post and, instead of the url, hilight the workflow nodes in your editor, copy them (ctrl-c), and paste (ctrl-v) into your message with a single line before and after containing 3 back ticks, like this:

```
{
  "nodes": [
    ...
  ]
}
```

I didn’t do that as it contained sensitive API keys. I’ve inserted but redacted those now.

If you want to keep that from being exposed, you can choose:

  • Authentication: Generic Credential Type
    • Generic Auth Type: Header Auth
      • Header Auth: Create a new credential → Fill In the Header Name and Value

This will hide the key away in a Credential Item so it won’t be included when you copy/paste (so you won’t have to redact it).

Regarding your actual HTTP call issue… it’s hard to guess what might be going wrong without at least a reference to how the API is structured. The closest thing I could find was this which indicates the “leadconnectorhq” service might be using Zapier. I didn’t see anything about “customFields” as a request parameter for their API though.

Your subject line indicates you might be intending to use APIs via GoHighLevel, in which case the URL you have in the HTTP Request node seems wrong.

Please add some more context info about what API you are trying to call.

Thanks. I’m using the HighLevel API…

Everything I’m doing works fine except for the customFields values.

Everything looks like it should work according to the API docs. What I suspect is happening is that the n8n HTTP Request node body options JSON + Using Fields Below is NOT actually blending the array into the rest of the JSON content like this:

{
    "name": "Test n8n Test",
    ...
    "customFields": [
        {
            "key": "contact.enquiry_portal_lead_id", 
            "field_value": "test-n8n-lead"
        },
        {
            "key": "contact.enquiry_category", 
            "field_value": "applicant"
        }
    ]
}

but might instead be escaping/encoding the nested JSON as a string like this

{
    "name": "Test n8n Test",
    ...
    "customFields": "[{\"key\": \"contact.enquiry_portal_lead_id\", \"field_value\": \"test-n8n-lead\"},{\"key\": \"contact.enquiry_category\", \"field_value\": \"applicant\"}]"
}

To confirm, change the HTTP Request node’s body from Using Fields Below to Using JSON, switch the value field to an expression type, and construct the JSON (expression) value as a JS object, converted to JSON at the end… like this:

{{ 
{
  name: $json.body.enquiry.name
  ...
  customFields: [
    {
      key: "contact.enquiry_portal_lead_id",
      field_value: "test-n8n-lead"
    },
    {
      key: "contact.enquiry_category",
      field_value: "applicant"
    }
  ]
}.toJsonString()
}}

Granted, this approach isn’t as friendly for modifying later, but it may be the only clear way to achieve what you want.
Also, constructing everything in JS object syntax and converting to JSON at the end ,with .toJsonString(), keeps you from having to deal with nested quote marks, etc.

Update: I got curious to see what n8n is actually sending, so I started up mitmproxy and configured n8n (actually axios within n8n) to send requests through it (env vars: HTTP_PROXY=http://mymitmproxy and HTTPS_PROXY=http://mymitmproxy).

That confirmed what I thought was happening to the customFields value. It does get escaped into a string instead of being added to the JSON hierarchy (i.e. it does not get inlined as JSON content). I think it will be necessary to do it the other way (Using JSON).

Any update on this? Wondering if some of these HighLevel bugs might get sorted out soon. Getting ready to set up a dozen clients on n8n-HighLevel integrations.

This is not a bug. Nothing will be sorted out. It is a clarification on how the n8n HTTP Request node’s Using Fields Below JSON construction is intended to work; you can’t embed JSON fragments as a field value because n8n escapes each field’s value as a string. You must choose the Using JSON option instead to handle more complex JSON structures.