Hi,
I am using a code node to remove columns from my JSON (for performance purpose):
Here is an example:
// Loop over input items and add a new field called 'myNewField' to the JSON of each one
const fieldsToDelete = [
'CustomerContact',
'AccountingContact',
'AccountingContactPosition',
'AccountingContactPhone',
'AccountingContactFax'
];
for (const item of $input.all()) {
fieldsToDelete.forEach(field => {
if (item.json.hasOwnProperty(field)) {
delete item.json[field];
}
});
}
return $input.all();
However, when running remove columns node (on a subworkflow or on another road), it actually removes the JSON columns on all roads.
Here below I remove columns on the main flow/road but the columns being deleted are also deleted when going in the subworkflow “Create or Update Contact”:
The workflow being very complicated and quite confidential, I can’t share it.
- **n8n version: 0.236.3 (cloud)
Thanks and regards,
Antoine