Filtering data and outputting to Function node with multiple outputs

To do it in the function after you split the payload you can do.

const output = []; 
const parts = msg.payload.split(",")
output[parts[2]-1]  = {
    payload: {
        message_nr: parts[2]
        //add other items here
    }
}
return output;

P.S When posting code please post as text so others can copy it and do not need to retype it.

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json