Help with google sheets read node

Hi all, I am struggling with one part of my personal finance workflow where I want n8n to read a large table from Google Sheets and then feed all of it to an OpenAI node. I already set it up but can’t figure out how to feed the OpenAI node the whole output from the Google Sheets read node. The table in GS is structured in 3 columns (Vendor, Category, Sub Category) and has about 400 rows. Each row is a Vendor that I have previously purchased from, and I categorized each vendor in the past under a category and sub category (e.g., Amazon, Entertainment, Online Shopping). I would like the OpenAI node to check this “database” of previously categorized vendors against the current one; if the vendor exists in the google sheets then use the same categories, if not then come up with appropriate ones. I just can’t seem to figure out how to feed the whole table in JSON format to the OpenAI node. Thanks for the help!

Information on your n8n setup

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

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:

hello @PinkFloyd

you can use the Aggregate node to combine all input from the GS into one item

Thanks @barn4k . Tried using the Aggregate node, this is what I got back from the OpenAI node: (for debugging, I asked it if it could read the existing mapping data I provided)

“No, I cannot read the existing mapping as it appears to be formatted incorrectly. What I see is a repetitive series of “[object Object]”. This suggests that the data may be represented in a JavaScript object format, but it is not being displayed properly, making it impossible to extract any specific details about the vendors, their short names, categories, or subcategories. To provide a readable format, the data needs to be presented in a clear tabular structure or as a list.”,

All good, this resolved it. “toJsonString()”

{{ $json.data.toJsonString() }}

2 Likes

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