Very basic problem with info output to sheets

Hi all, hope you are all doing well!

I have been wrestling with a very basic problem, and need some help please.

Basically, I am passing data from 3 agents (Product SKU, Title, Description AI Agents generators) to a set node and then onto a spreadsheet. I need the data to be in the same row.

However the output to the sheet isn’t working, it only pastes in descriptions, and excludes the title and SKU.

In the Set node, you can see that the {{ $json.output }} is the same for all 3 value fields, but the code for all 3 outputs from the agents were all the same…

Any help would be greatly appreciated! Thanks

Hey @Nick_B

The problem is that you have 3 different items with the same key (“output”).

You need to merge the outputs into 1 item only with different keys.

Here my suggestion:

Let me know if it works!

Hey Theo, thank you so much for the help, it worked, but I ran into another minor problem if you don’t mind me asking please.

Basically, the newly added code node is only outputting the Title field for some reason, which makes no sense.

@Nick_B

Glad I helped, but you still have an issue because you didn’t merge as I suggested :wink:

You’ve selected “append” method in the merge node, meaning all items are appened resulting in 3 items. Then you’re requesting in the code node the 1st item each time. With 3 items triggering the code node, you’re requesting 3 times the 1st item. Since you have only the title in the 1st item, at the end you’re getting 3 times the Title from the 1st item :sweat_smile:

Use the “combine” method with “by position” parameter and 3 inputs, each plugged to each agent, and it should work.

Then you don’t need the code node anymore!

Let me know if it works!

1 Like

Thank you very much Theo! No idea how I missed copying the merge node from the workflow you provided, stupid mistake :person_facepalming:

Have a lovely week ahead buddy :slight_smile: