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

revision 246b94cf696a5052f66ecbba0d31b5f10c5026e8

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