n8n: combine markdown of multiple items into a single text string

revision b98a1561027c6d9c36c3099fe3b92c6ccf26be5d

raw

code.js

1
2
3
4
5
6
7
8
// Node type: Code
// Mode: Run Once for All Items
// Language: Javascript
 
const items = $input.all();
const combinedText = items.map((item) => item?.json.data).join("\n\n");
 
return { combined: combinedText };

History