How to get the multiple items records

Describe the problem/error/question

Hi,
How I can get the multiple records from http node and assign them to a set node.

Reference: Get data

What is the error message (if any)?

NA

Please share your workflow

Share the output returned by the last node

479737671
596903640
372393829

Information on your n8n setup

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

@Gouravdev , as “getHubSpotAccountDetails1” node is directly connected to the “listItems1” node, the expression could be simplified like this, {{ $json.properties.hubspot_owner_id }}. This way you will run “getHubSpotAccountDetails1” node for each item in “listItems1” node (as opposed to just the first one).

Thanks @ihortom

But what if I have other nodes before getHubSpotAccountDetails1

@Gouravdev , you seem to be coming from a different workflow automation platform with linear execution. n8n is particularly great due to ability to branch the workflow making it much easier to follow and debug.

I advise you not to mix different tasks - branch them as we discussed it already in your other post and merge the branches when appropriate.

Before I reply to the specific question of yours let me point out that the last node (in the last workflow) appears to use HubSpot API where you GET a specific owner by referencing him by ID. However, none of the previous nodes produce the ID to use in the last node. Your very first workflow makes more sense to me.

But what if I have other nodes before getHubSpotAccountDetails1

There could be different ways to achieve it. Here’s the one which makes it clearer and more manageable as less coding is involved.

I would still prefer using branching instead

@ihortom this post is different from the last one. Here my question is related to the assign value

I want to assign the values I got from listItems1 to getHubSpotAccountDetails1 or set them into brevoUser.

For example, the owner IDs I got from listItems1 are:

  • 479737671
  • 596903640
  • 372393829

In brevoUser, I want to assign these owner ID values to brevoUserEmails so that the outcome is:

  • 479737671
  • 596903640
  • 372393829

How can this be achieved?

@Gouravdev , my answer is still the same - use branching and then merge using the common attribute.

The problem with your workflow as I see it is, you have 2 related but loosely coupled tasks

  1. Get HubSpot companies and all the users associated with them
  2. Get Brevo users for presumably the same organizations

I do not see what would be the common attribute as each system uses own properties/values which seem to be dis-joined. From the discussions with you so far, it seems that the common attribute could be the user email address.

In your linear workflow you put “apples and pears in a one bucket” which adds no clarity to what you are doing. Again, separate HubSpot and Brevo related tasks and join them once you found a common attribute.

Assuming that email address is the common property, your workflow could look something like this.

I believe that “getHubSpotAccountDetails1” node returns the properties id and userId (not sure which one you are after) and email while “brevoUserEmails” node contains brevoUserEmails. Therefore you can merge those by matching email addresses. This way your Brevo user will obtain HubSpot owner ID.

1 Like

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