APIs & Integrations

tberneman
Member

Pass additional field(s) to/with HTTP response data

I'm using n8n and getting a list of all my users then gathering all the tasks for each user so that I can add them to our local SmarterMail server. As you can see in the screenshot I'm getting the Task info data on the right but none of the data on the left. I want the email address on the left to pass through to the HTTP response on the right.

 

2024-02-22 16_45_41-n8n.png

I tried acomplishing this by adding a "fields" section to the JSON in my Body but don't know if I have the right idea or if it's not even possible.

 

{
"fields": [ { "email": "jon.doe@domain.com" } ],
"properties": [
"hs_task_subject",
"hs_task_body",
"hs_task_type",
"hs_task_priority",
"hs_task_email",
"hs_timestamp",
"hs_task_status" ]
}

 

Hopefully someone has had a similar issue and figured out a solution.

 

Thank you!

0 Upvotes
1 Reply 1
zach_threadint
Top Contributor

Pass additional field(s) to/with HTTP response data

Hi @tberneman 👋

 

As far as I can tell, you're n8n "Output" in this case is limited by what can be returned by HubSpot's CRM Search API. Any unsupported request JSON body keys (incl. "fields") is typically ignored by this API. Furthermore, it looks like Task Owner Email Address is not a standard property within HubSpot's "Task" object type, so it's not as simple as adding this to your requested properties.

 

I think you'll need to design a solution that references the "email" from your "Input" per HubSpot Owner (assuming this is happening within a loop?). Alternatively, maybe you could add "hubspot_owner_id" to your requested Task properties to be returned and operate some kind of lookup table "hubspot_owner_id" to HubSpot Owner "email".

 

I hope this proves useful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes