Combine data outputs

Good morning,
I am trying to create a workflow which starts with a form in telly which is connected to n8n through a webhook, I need to add that information to a google sheet but first I need to generate a unique ID which is formed by “R- Date (ddmmyy format) - sequence of numbers that resets every month”
The problem I have is that when the information arrives in Google Sheet it only gives me the ID information and the content of the form has been lost.
Could you help me so that this information from the form + the ID reaches the Google Sheet
I leave an image of the nodes that I have used, if you have a more effective way to do this please tell me






Generate the ID within the item itself using a Code or Function node
Use the webhook as the sole input. Then, create a Function node (JavaScript) that generates the ID and adds it to the form’s JSON object:

let item = $input.item.json;
item.id = generateID(); // custom code for R‑DDMMYY‑n
return [{ json: item }];

This way, the form and the ID travel together to Google Sheets in a single item.

Webhoo(Form) - Code (generate ID and add to JSON) - Google Sheets (Create Row)

1 Like

By default, each node in an n8n workflow passes its own output to the next node, replacing the data from previous steps. This is the core of the issue you’re facing.

In your workflow, the ‘Obtener fila(s) en la hoja’ node outputs 32 items, representing the existing rows in your sheet. However, the ‘Generar ID’ node that follows only outputs a single new item. When this happens, the data from the original form submission is lost.

The most effective solution is to merge the original form data with your newly generated ID. Instead of a loop, you can use a Set node to combine these two separate pieces of information before saving them to the Google Sheet. This ensures that all the required data is present for the final step.

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