How do I create an in-memory table for testing?

How do I create a small table “in memory” from a node similar to “set” or so?

For example:

+-----------+--------+--------+
| City      | Year   | Amount |
+-----------+--------+--------+
| Barcelona | 2024   | 33     |
| Barcelona | 2027   | 88     |
| Barcelona | 2028   | 77     |
| Madrid    | 2023   | 55     |
| Madrid    | 2024   | 11     |
| Ibiza     | 2025   | 22     |
+-----------+--------+--------+

So I can play with manually starting the workflow and see how a file is written?

1 Like

Hi @xmontero, the set node can only generate a single item, but you could use the Function node for this. Here’s an example:

Result:

Note: In older versions of n8n you would have to return the full data structure used by n8n, in newer versions you can use the approach shown above.

Ah great!!! I’ll try it! Thank you very much!