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

raw

code.js

1
2
3
4
5
6
7
8
9
// Node type: Code
// Mode: Run Once for All Items
// Language: Javascript
// Source: https://community.n8n.io/t/create-markdown-file-from-an-array-of-strings/122148/2
 
const items = $input.all();
const combinedText = items.map((item) => item?.json.data).join("\n\n");
 
return { combined: combinedText };
Christian Weiske Christian Weiske
owner

History