Use expression for a fixedCollection type

Hello there!

I have a custom node that has a parameter of type fixedCollection as input, specifiaclly a list of emails and names.

Is it possible to fill that fixedCollection with the output of the previos node? I mean, I do not know in the first place how many elements (email and name pairs) I have.

I can use a expression for each email and name value but not for the entire fixedCollection

Thanks in advance!

  • n8n version: 1.18.1
  • Database: SQLite
  • n8n EXECUTIONS_PROCESS setting: own
  • Running n8n via: Docker

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @efdezpolo, welcome to the community!

It’s been a while since I’ve built a node, but I believe you can still fetch all incoming items from the previous node using this.getInputData(); and then process them however you want :slight_smile:

The docs at Tutorial: Build a programmatic-style node | n8n Docs would have an example of how to use this method.

Thanks for the answer!

I didn’t explain myself properly. I have only one item coming from the previous node which contains an array of emails.

I get your point, I can move to a programatic node and then do whatever I want with incoming data. I do not get this because how I am supposed to use the incoming data. I have to make a convention like if there is a field called targetEmailAddresses with the expected structure add it to the list of emails defined in the node? Sounds fragile.

I will go this way until I find a better solution.

1 Like