Postgres: Accesing and merging data from previews node

I’m having difficult accessing and merging data from a Postgres and previous node when the Postgres node returning less data in the array duo to 0 row is completed ignore in the output.

For example:

Node1: Read data from Google Sheets. returning 100 data.
Node2: Select data from Postgres but only found 90. (10 of them has 0 row so its ignore in the output)
Node3: Trying to merge data from Node1 and Node2 respectively.

Even if I enable Always Output Data on Postgres node. still returning 90 in the array. The index 0 of the Postgres does not match the index 0 from Node1.

any comments or suggestions would be greatly appreciated. thank you

You can make it work in two different ways:

  1. Write the postgres query in a way that it always returns data. So that if nothing gets found it returns some placeholder data.
  2. Use the Merge-Node in mode “Merge By Key”. You then have to make sure that the results of both nodes have a key you can merge by, like an ID.

Hi jan, thank you for quick response.

I ended up doing your second suggestion.

Glad to hear that I could help!

Have fun!