# 4 Possible inputs into one output

**URL:** <https://community.n8n.io/t/4-possible-inputs-into-one-output/44247>\
**Category:** Questions\
**Created:** [April 14, 2024, 2:20pm UTC](https://community.n8n.io/t/4-possible-inputs-into-one-output/44247 "2024-04-14T14:20:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian1](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@Sebastian1](https://community.n8n.io/u/Sebastian1)\
**Post date:** [April 14, 2024, 2:20pm UTC](https://community.n8n.io/t/4-possible-inputs-into-one-output/44247/1 "2024-04-14T14:20:26Z")

</div>

Hello,

I have one Item as input

[  
{  
“hasName”: true,  
“itemId”: 12639,  
“hasName2”: true,  
“itemId2”: 12640  
}  
]

Now I want to have 4 different possible routes which should end in one with two items but they should be one so I have no two different runs.

I tried with a switch which should do the job but this switch did only gave me one output route and the other did not output. E.g. configured like hasName = true and hasName2 = true and the same for false. But when hasName was true und hasName2 false it did only output at hasName = true and hasName2 = false did not.

So I did have a look in the forum here and someone suggested to work with filters. This works but then I get two items as output.

Is there a more elegant way to do what I want todo here? 😊

I use version 1.33.1 (self Hosted)

This is a part of the scenario

---

<div class="post-metadata">

**Author:** ![n8n](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/n8n/32/26906_2.png) [@n8n](https://community.n8n.io/u/n8n)\
**Post date:** [April 14, 2024, 2:20pm UTC](https://community.n8n.io/t/4-possible-inputs-into-one-output/44247/2 "2024-04-14T14:20:27Z")

</div>

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:**

---

<div class="post-metadata">

**Author:** ![ihortom](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ihortom/32/11473_2.png) [@ihortom](https://community.n8n.io/u/ihortom)\
**Post date:** [April 14, 2024, 7:06pm UTC](https://community.n8n.io/t/4-possible-inputs-into-one-output/44247/3 "2024-04-14T19:06:42Z")

</div>

@Sebastian1 , all the states of your “object” could be described by 2-bits binary number:

```auto
hasName hasName2
-----------------
true true
false true
true fasle
false false

```

In other words, those 4 states could be represented as binary (== decimal):

```auto
0b11 == 3: hasName and hasName2 are true
0b01 == 1: only hasName2 is true
0b10 == 2: only hasName is true
0b00 == 0: hasName and hasName2 are false

```

If your Code node adds this binary number (or equivalent decimal) representing the state, you can check the state of your object with switch as below.

Note that only one Switch output will be at play here.

Does it look simpler to you?

---

<div class="post-metadata">

**Author:** ![Sebastian1](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@Sebastian1](https://community.n8n.io/u/Sebastian1)\
**Post date:** [April 15, 2024, 7:55am UTC](https://community.n8n.io/t/4-possible-inputs-into-one-output/44247/4 "2024-04-15T07:55:27Z")

</div>

@ihortom thank you for that idea. This works well! When I did understand it it does look simpler now yes. But took some minutes 🙂

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/36532_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [April 22, 2024, 7:55am UTC](https://community.n8n.io/t/4-possible-inputs-into-one-output/44247/5 "2024-04-22T07:55:43Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
