Add additional fields to HTTP node output

Describe the problem/error/question

I’m grabbing data from Hubspot via the http node and collecting that data successfully but I want to pass the “email” field into the output as per the screenshot. How can I include additional fields to my output?

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @tim.berneman,

You will need a merge node so it can combine the records based on a bit of information that is shared between the 2 datasets.

But before you add that after the http request node you will need a split out items node that splits the results field. You could also try it with a set node but you have 1 input and 7 outputs so there could be some more tweaking to do.

There is no information that is shared between the two, that’s why I’m trying to include the email address which is the common field but it’s not included in the data hubspot sends back. I’m trying to see if there’s something I can add to the Body that will include the email. If it’s possible it’s probably specific to Hubspot but I’m sharing my Body JSON just in case someone might have a suggestion.

{
    "properties": [
        "hs_task_subject",
        "hs_task_body",
        "hs_task_type",
        "hs_task_priority",
        "hs_task_email",
        "hs_timestamp",
        "hs_task_status"
    ]
}

I tried adding a “fields” block with the email ‘hardcoded’ at the top but that didn’t work.

{
    "fields": [
        {
            "email": "[email protected]"
        }
    ],
    "properties": [
        "hs_task_subject",
        "hs_task_body",
        "hs_task_type",
        "hs_task_priority",
        "hs_task_email",
        "hs_timestamp",
        "hs_task_status"
    ]
}

I’m trying to find an answer on n8n’s site but no luck so far.

Hey @tim.berneman,

If there is nothing common to identity the record it is going to be very hard to work out if the data is correct.

One thing you could try is using {{ $('IF4').item.json.results.email }} in a set node after the hubspot node and that should help link the records.

I will try the IF4 solution this morning. I did find a way to pass the Owner ID through but then I will have to do a lookup and Merge with that so I like the IF4 solution better.

In case someone else runs across this post here’s how I get the Owner ID in the HTTP return payload from Hubspot via the Body JSON:

{
    "properties": [
        "hubspot_owner_id",
        "hs_task_subject",
        "hs_task_body",
        "hs_task_type",
        "hs_task_priority",
        "hs_task_email",
        "hs_timestamp",
        "hs_task_status"
    ]
}
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.