Changing binary field name [ data ] google drive

Describe the problem/error/question

Hi

I am using google drive to download two pdf files. Then I would like to use merge combine and later send them in one email.

However the fields are named both “data”, how can i rename them ?

The merge seems to overwrite since both are named “data”

Thanks

What is the error message (if any)?

Please share your workflow


n8n2

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:

const binaryPropertyName = “data”; // Original binary property name
const newBinaryPropertyName = “data1”; // New binary property name

const binaryData = items[0].binary[binaryPropertyName];

if (!binaryData) {
throw new Error(“No binary data found”);
}

// Return the binary data with the new name
return [{ binary: { [newBinaryPropertyName]: binaryData } }];

// Resolved by the above code in the code node. Then used merge combine all.

1 Like