Need Help with Matching Output to the Correct Row in Google Sheets

Hello n8n Community,

I’m working on an automation that involves using the OpenAI node to generate product descriptions for a Google Sheets spreadsheet. This sheet contains columns such as ‘Color’, ‘Gender’, ‘Material’, ‘Pattern Description’, etc., and the idea is for the OpenAI Assistant to create product descriptions and titles based on these attributes.

In the process, I have the following steps:

  1. Read the product attributes from a specific row in the spreadsheet (say row 2).
  2. Send these attributes to the OpenAI node to generate a ‘Rich Description’ and ‘Rich Title’.
  3. Update the same row in the Google Sheets with the generated content, placing the descriptions and titles in their respective columns.

However, I’m encountering a problem: the data is being appended as new rows or is updating the wrong rows instead of updating the exact rows where the attributes were originally read from. Ideally, if the information is read from row 2, the ‘Rich Description’ and ‘Rich Title’ should be placed back into the corresponding cells in row 2.

I’m not sure why the “Update Row” operation isn’t matching and updating the rows correctly based on a unique identifier (which I expected to be the “Parent Code” or “Código Pai”). When I switch to “Append Row,” it functions, but obviously, this isn’t the desired outcome as it doesn’t update the existing row.

Has anyone dealt with similar issues or could provide insight into what might be going wrong? I suspect there might be a mismatch or a missing piece in how I’m identifying the rows for the update.

Any suggestions or guidance would be hugely appreciated, and if more details are needed, I’m happy to provide them.

Attached are the screenshots to give you more context on the setup and the issue at hand.

Thank you all for your assistance!


It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Like this?

The column “descrição” has updated by OpenAI:

2 Likes

Utilizando seu modelo, consegui encontrar o erro. Valeu.

1 Like

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