Describe the problem/error/question - I have built a workflow that looks at my email if its a PDF it will extract the infromation and append to a google sheet. I simply want to account for the case where there is multiple PDFs, in the code block I have set it up as such
const items = ;
for (const inputItem of $items()) {
const binary = inputItem.binary || {};
const json = inputItem.json || {};
for (const [key, value] of Object.entries(binary)) {
if (value.fileExtension === ‘pdf’) {
items.push({
json: {
attachment_key: key,
dedupe_key: ${json.id}_${key},
fileType: value.fileType,
fileExtension: value.fileExtension,
},
binary: {
[key]: value
}
});
}
}
if (Object.keys(binary).length === 0) {
items.push({ json: { notice: ‘no PDFs found’ } });
}
}
return items;
to seperate the items ensuring that binary file is being outputted .I then split based on attachment_key, check if it is a PDF then through a dedupe_key check if it exists in the google sheet if it doesn’t I append it ensuring that i do not upload the same emails into the google sheet. Now when I reach the append stage all of the values say “[Can’t determine which item to use]”. I’m not sure why as I thought I have split it already and cannot use “{{ $json.headers.from }}” as my previous statement is an if statement checking for duplicates. Would appreciate your insight on how to solve this! Thanks!
What is the error message (if any)? [Can’t determine which item to use]
Please share your workflow
Share the output returned by the last node
[Can’t determine which item to use] / ExpressionError: Multiple matches found at createExpressionError (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-workflow@file+packages+workflow/node_modules/n8n-workflow/src/workflow-data-proxy.ts:790:11) at createPairedItemMultipleItemsFound
Information on your n8n setup
- n8n version:2.1.5
- Database (default: SQLite): GoogleSheets
- n8n EXECUTIONS_PROCESS setting (default: own, main): own
- Running n8n via (Docker, npm, n8n cloud, desktop app): n8ncloud
- Operating system:MacOS Sequoia 15.6.1
