Multiple matching items for item in Google Upload. Trying to preserve file name after

Describe the problem/error/question

When using google drive to monitor for new files, if it detects multiple files, when I go to upload and use the original ID for the filename, it says there are multiple matching items for that ID.

What is the error message (if any)?

Multiple matching items for item [0]

An expression here won’t work because it uses .item and n8n can’t figure out the matching item. (There are multiple possible matches)

Try using .first(), .last() or .all()[index] instead of .item or reference a different node.

Please share your workflow

Share the output returned by the last node

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:

hello @dfawlt

You haven’t specified in what node the issue occurs. But generally, better not to use the Code node in the “Run once for all items” mode. It may break the sequence.

This happens in the Upload file node.

I’m trying to remove columns C and D then move column E to C. I’ll try and find a different approach other than code node to remove the columns.

This is detecting 3 spreadsheets were added. I used your edit fields to trim the columns, so much simpler thank you. But I still have the multiple items issue at the upload. And I hope that n8n is treating each spreadsheet individually and not merging them.

Ah, that’s because your Extract node is extracting data from all 3 files and then outputting them as a single array of items, which later gets combined into one CSV file.

To avoid such a case, use a sub-workflow and move these nodes to it (you can select the desired nodes, then click with the right mouse and select the “Move to Sub-workflow” option)

You can also use the Loop node, but that will consume much more memory

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